Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

repeater control

Status
Not open for further replies.

maneland

Programmer
Mar 24, 2006
24
ES
Hi:

I'm using this Repeater control:

<asp:repeater id=RepeaterImg runat="server" >
<headertemplate>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
</headertemplate>
<ItemTemplate>
<tr>
<td><%# DataBinder.Eval(Container.DataItem,"nombre_es") %></td>
<td><%# DataBinder.Eval(Container.DataItem,"nombre_es") %></td>
<td><%# DataBinder.Eval(Container.DataItem,"nombre_es") %></td>
<td><%# DataBinder.Eval(Container.DataItem,"nombre_es") %></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:repeater>

How can I go to the next result row after the firts "<td><%# DataBinder.Eval(Container.DataItem,"nombre_es") %></td>". I would like show differents nombre_es in each <td>,

Thanks
 
You can't. You'll need to re-order your html so that the next repeat creates a new column rather than a new row.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
the Container.DataItem will be only one value, you will need to modify your datasource to spit out nombre_es1, nombre_es2,...

But a repeater should do that for you for each record in your datasourse...this should return
Code:
<asp:repeater id=RepeaterImg runat="server" >
                <headertemplate>
                    <table border="0" cellspacing="0" cellpadding="0" width="100%">
                    <tr><td colspan=2>Names<br>-----</td></tr>                  
                </headertemplate>
                <ItemTemplate>
                    <tr>
                        <td>Name:</td>
                        <td><%# DataBinder.Eval(Container.DataItem,"nombre_es") %></td>                
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    </table>
                </FooterTemplate>
            </asp:repeater>

Names
-----
Name: Jorge Smith
Name: Ricardo Jones
and on and on
 
Dear:

I don´t know how because I need 3 columns per rows. The command is:

System.Data.SqlClient.SqlCommand SqlCommand = new System.Data.SqlClient.SqlCommand("SELECT nombre_es FROM Table WHERE cod_x=1", sqlConn);

Thanks
 
Then you need to change what you are using! Use a DATALIST!

This will give you exactly what you need i think, with the RepeatLayout=Table, it does most for you
Code:
                    <asp:DataList ID="RepeaterImg" runat="server" RepeatColumns="3" RepeatDirection="Horizontal"
                        RepeatLayout="Table" Width=100%>
                        <ItemTemplate>
                            <td>
                                <%#DataBinder.Eval(Container.DataItem, "nombre_es")%>
                            </td>
                        </ItemTemplate>
                    </asp:DataList>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top