I know this is a bit odd, but there’s a good reason for it.
I have a DataGrid, and inside the Datagrid there is a Repeater, and inside the Repeater, there is a CheckBoxList
<asp:DataGrid ID="dg" runat="server">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:Repeater ID="rep" runat="server">
<ItemTemplate>
<asp:CheckBoxList ID="cbl" runat="server" DataTextField="Name" DataValueField="ID"></asp:CheckBoxList>
</ItemTemplate>
</asp:Repeater>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</Components:ExtendedDataGrid>
This is resulting in a fairly bizarre issue. Clicking on the labels in the first repeater item works fine. However, in the second repeater item, the labels get off.
- If you click the 2nd item in the 2nd group, the 1st item in the 2nd group is selected.
- If you click the 1st item in the 3rd group, the last item in the 2nd group is selected.
- If you click the 3rd item in the 3rd group, the 1st item in the 3rd group is selected.
So, it skips 1 in the second group, skips 2 in the 3rd, etc. Very weird.
When I view the source, I can see that the “for” attributes on the labels are, indeed, wrong.
Any ideas at all?
Ok… I finally got back to this and figured it out. I actually had a hidden field next to the checkboxlist that I didn’t mention. For some reason, when I took that out, everything else started working just fine.