reverendleo
08-29-2005, 08:04 PM
Greetings!
I don't know why I'm having such a hard time with this, but here is what I'm trying to do:
The data set returns a table essentially like this:
Sub Type | Name | Phone #
so...multiple records with a data grid come out like this:
Bollards | Company A | 555-5555
Bollards | Company B | 555-5678
Bollards | Company C | 555-9999
Gabions | Company D | 555-9876
Gabions | Company E | 555-1234
I'm trying to implement nested Repeaters so that the output looks something like this:
Bollards:
Company A | 555-5555
Company B | 555-5678
Company C | 555-9999
Gabions:
Company D | 555-9876
Company E | 555-1234
For some reason, my nested repeater is not being recognized as such. When I try to bind data to it earlier in my code, I get an error saying the repeater is undifined, although it rests just below the <ItemTemplate> tag of the first repeater. I tried specifying the DataSource in the <asp:repeater> tag, but that gives me a parse error.
I'm not sure if my structure is right either, but here is that section of code (note this doesn't work currently):
<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate>
<table border="1">
</HeaderTemplate>
<ItemTemplate>
<asp:Repeater ID="Repeater2" runat="server" DataSource='values'>
<ItemTemplate>
<tr>
<td width="20"> </td>
<td><%#DataBinder.Eval(Container.DataItem, "SubType")%></b></i></td>
<td width="120"><%#DataBinder.Eval(Container.DataItem, "Company Name")%></td>
<td width="110"><%#DataBinder.Eval(Container.DataItem, "Contact")%></td>
<td width="110"><%#DataBinder.Eval(Container.DataItem, "Phone")%></td>
<td width="30"><%#DataBinder.Eval(Container.DataItem, "Extension")%></td>
<td width="110"><%#DataBinder.Eval(Container.DataItem, "Fax")%></td>
<td width="110"><%#DataBinder.Eval(Container.DataItem, "Mobil")%></td>
<td width="120"><%#DataBinder.Eval(Container.DataItem, "Extra")%></td>
<td width="120"> </td><p>
</table>
</tr>
</ItemTemplate>
</asp:Repeater>
</itemtemplate>
</asp:Repeater>
Any advice is SINCERELY appreciated! I'm stumped.
I don't know why I'm having such a hard time with this, but here is what I'm trying to do:
The data set returns a table essentially like this:
Sub Type | Name | Phone #
so...multiple records with a data grid come out like this:
Bollards | Company A | 555-5555
Bollards | Company B | 555-5678
Bollards | Company C | 555-9999
Gabions | Company D | 555-9876
Gabions | Company E | 555-1234
I'm trying to implement nested Repeaters so that the output looks something like this:
Bollards:
Company A | 555-5555
Company B | 555-5678
Company C | 555-9999
Gabions:
Company D | 555-9876
Company E | 555-1234
For some reason, my nested repeater is not being recognized as such. When I try to bind data to it earlier in my code, I get an error saying the repeater is undifined, although it rests just below the <ItemTemplate> tag of the first repeater. I tried specifying the DataSource in the <asp:repeater> tag, but that gives me a parse error.
I'm not sure if my structure is right either, but here is that section of code (note this doesn't work currently):
<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate>
<table border="1">
</HeaderTemplate>
<ItemTemplate>
<asp:Repeater ID="Repeater2" runat="server" DataSource='values'>
<ItemTemplate>
<tr>
<td width="20"> </td>
<td><%#DataBinder.Eval(Container.DataItem, "SubType")%></b></i></td>
<td width="120"><%#DataBinder.Eval(Container.DataItem, "Company Name")%></td>
<td width="110"><%#DataBinder.Eval(Container.DataItem, "Contact")%></td>
<td width="110"><%#DataBinder.Eval(Container.DataItem, "Phone")%></td>
<td width="30"><%#DataBinder.Eval(Container.DataItem, "Extension")%></td>
<td width="110"><%#DataBinder.Eval(Container.DataItem, "Fax")%></td>
<td width="110"><%#DataBinder.Eval(Container.DataItem, "Mobil")%></td>
<td width="120"><%#DataBinder.Eval(Container.DataItem, "Extra")%></td>
<td width="120"> </td><p>
</table>
</tr>
</ItemTemplate>
</asp:Repeater>
</itemtemplate>
</asp:Repeater>
Any advice is SINCERELY appreciated! I'm stumped.