B
Brian Miller
So much for ASP.Net controls being easier to set up than classic ASP
ones. I'm trying to set up a page that will contain a couple grids
with 4 checkboxes per row, with the number of rows dependent on my
number of records returned. I figured for this approach, I would use
a repeater control, with the asp:checkbox controls nested within each
row, like as follows:
<asp:Repeater ID="Section1Repeater" Runat="server"
OnItemDataBound="Section1Repeater_ItemDataBound">
<ItemTemplate>
<tr bgcolor=white>
<td align=center>
<asp:Label ID="Section1Activity" Runat="server"></asp:Label>
</td>
<td align=left>
<asp:Label ID="Section1ActivityDescription"
Runat="server"><%#Container.DataItem("Description")%></asp:Label>
</td>
<td align=center>
<asp:Label ID="Section1ActivityTemplate"
Runat="server"><%#Container.DataItem("Template")%></asp:Label>
</td>
<td align=center>
<asp:CheckBox ID="Section1SmallCheckbox" Runat="server" />
</td>
<td align=center>
<asp:CheckBox ID="Section1MediumCheckbox" Runat="server" />
</td>
<td align=center>
<asp:CheckBox ID="Section1LargeCheckbox" Runat="server" />
</td>
<td align=center>
<asp:CheckBox ID="Section1TechnologyOnlyCheckbox"
Runat="server" />
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
After constructing the HTML tables with repeaters such as this one
within them, I realized there is no direct approach apparently to
binding checkboxes to data. I can't bind each checkbox individually
due to not knowing the number of records that will be returned, so how
can I go about this, and still be able to wire up check/uncheck events
so I can update the associated datarow with each? BTW, the fields
that will be associated with each of the 4 checkboxes are contained in
the same table, however, they are not group items and need to be
evaluated separately. Any help would be very greatly appreciated!
Thanks,
Brian
ones. I'm trying to set up a page that will contain a couple grids
with 4 checkboxes per row, with the number of rows dependent on my
number of records returned. I figured for this approach, I would use
a repeater control, with the asp:checkbox controls nested within each
row, like as follows:
<asp:Repeater ID="Section1Repeater" Runat="server"
OnItemDataBound="Section1Repeater_ItemDataBound">
<ItemTemplate>
<tr bgcolor=white>
<td align=center>
<asp:Label ID="Section1Activity" Runat="server"></asp:Label>
</td>
<td align=left>
<asp:Label ID="Section1ActivityDescription"
Runat="server"><%#Container.DataItem("Description")%></asp:Label>
</td>
<td align=center>
<asp:Label ID="Section1ActivityTemplate"
Runat="server"><%#Container.DataItem("Template")%></asp:Label>
</td>
<td align=center>
<asp:CheckBox ID="Section1SmallCheckbox" Runat="server" />
</td>
<td align=center>
<asp:CheckBox ID="Section1MediumCheckbox" Runat="server" />
</td>
<td align=center>
<asp:CheckBox ID="Section1LargeCheckbox" Runat="server" />
</td>
<td align=center>
<asp:CheckBox ID="Section1TechnologyOnlyCheckbox"
Runat="server" />
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
After constructing the HTML tables with repeaters such as this one
within them, I realized there is no direct approach apparently to
binding checkboxes to data. I can't bind each checkbox individually
due to not knowing the number of records that will be returned, so how
can I go about this, and still be able to wire up check/uncheck events
so I can update the associated datarow with each? BTW, the fields
that will be associated with each of the 4 checkboxes are contained in
the same table, however, they are not group items and need to be
evaluated separately. Any help would be very greatly appreciated!
Thanks,
Brian