G
GD
I'd like to use a Repeater to display data coming back from a cross-tab
report. Because it's a cross-tab, I generally don't know how many
columns are coming back. They do follow a certain format:
e.g. CompanyName, c1, c2, c3, etc ..
The current format of my repeater is:
<table>
<asp:Repeater ID="rptCompanies" Runat="server">
<ItemTemplate>
<tr class="Company">
<td><%# DataBinder.Eval(Container.DataItem, "CompanyName") %></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
what I would need is something like:
<table>
<asp:Repeater ID="rptCompanies" Runat="server">
<ItemTemplate>
<tr class="Company">
<td><%# DataBinder.Eval(Container.DataItem, "CompanyName") %></td>
<td><%# DataBinder.Eval(Container.DataItem, "c1") %></td>
<td><%# DataBinder.Eval(Container.DataItem, "c2") %></td>
<td><%# DataBinder.Eval(Container.DataItem, "c3") %></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
But since I don't know how many columns I have coming back, I can't
specify them in the repeater. How can I accomplish this? A nested
repeater?
P.S. I know this can be easily done using a DataGrid, if there's not a
good way to accomplish it using a Repeater, I'll go in that direction.
Thanks
report. Because it's a cross-tab, I generally don't know how many
columns are coming back. They do follow a certain format:
e.g. CompanyName, c1, c2, c3, etc ..
The current format of my repeater is:
<table>
<asp:Repeater ID="rptCompanies" Runat="server">
<ItemTemplate>
<tr class="Company">
<td><%# DataBinder.Eval(Container.DataItem, "CompanyName") %></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
what I would need is something like:
<table>
<asp:Repeater ID="rptCompanies" Runat="server">
<ItemTemplate>
<tr class="Company">
<td><%# DataBinder.Eval(Container.DataItem, "CompanyName") %></td>
<td><%# DataBinder.Eval(Container.DataItem, "c1") %></td>
<td><%# DataBinder.Eval(Container.DataItem, "c2") %></td>
<td><%# DataBinder.Eval(Container.DataItem, "c3") %></td>
</tr>
</ItemTemplate>
</asp:Repeater>
</table>
But since I don't know how many columns I have coming back, I can't
specify them in the repeater. How can I accomplish this? A nested
repeater?
P.S. I know this can be easily done using a DataGrid, if there's not a
good way to accomplish it using a Repeater, I'll go in that direction.
Thanks