Repeater Control: How to repeat in rows of x?

S

SamIAm

Hi

I need a repeater control (not datalist) to display a table containing 3
columns of data per row. i.e.

<table>
<tr>
<td>Item 1</td>
<td>Item 2</td>
<td>Item 3</td>
</tr>
<tr>
<td>Item 4</td>
<td>Item 5</td>
<td>Item 6</td>
</tr>
</table>

How can a achieve this using a repeater control?

Thanks,

S
 
S

SamIAm

Thanks for the reply Justin, but that article only shows you how to get data
out and loop through it displaying 1 column per row at a time. I need to
display more than one column per row.

S
 
S

S. Justin Gengo

SamIAm,

In that case use of a datagrid might be better.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
S

SamIAm

"I need a repeater control (not datalist) to display a table containing 3
columns of data per row"
 
S

S. Justin Gengo

SamIAm,

I'm not certain why you can't use a datagrid but the code for the repeater
would be similar to this:

<Table id="Table1" Width="100%" border="1" CellPadding="5" CellSpacing="0">
<asp:Repeater ID="Repeater1" runat="server">
<ItemTemplate>
<tr>
<td>
<%# DataBinder.Eval(Container.DataItem,
"FirstColumnData") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem,
"SecondColumnData") %>
</td>
<td>
<%# DataBinder.Eval(Container.DataItem,
"ThirdColumnData") %>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
</Table>

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top