This is driving me nuts. I have a checkbox in a grid.<BR>I am looping threough to grab their checked state when the button is clicked. I continue to get a "False" for the boxes even though I have checked them. Any thoughts?<BR><BR> Dim i as integer<BR> Dim _item as DataGridItem<BR> For i = 0 to ShowMods.Items.Count-1<BR> _item = ShowMods.items(i)<BR> Dim ApprBox as CheckBox = _<BR> CTYPE(_item.FindControl("appr"), Checkbox)<BR> If ApprBox.checked = true then<BR> response.write("yes" & "<BR>")<BR> End If<BR> NEXT <BR><BR><asp
ataGrid <BR>id="ShowMods" <BR>RUNAT="server" <BR>autoGenerateColumns="false"><BR><BR><COLUMNS><BR> <asp:TemplateColumn><BR> <ItemTemplate><BR> <asp:checkbox runat="server" id="appr"/><BR> </ItemTemplate><BR> </asp:TemplateColumn><BR></COLUMNS>Try this instead:<BR>If ApprBox.checked thenNope that didn't help. I don't undertstand it.<BR>It keeps telling me the box has not been checked.<BR>I know it is finding the checkbox control because<BR>ApprBox returns the control. But when I check it <BR>for "checked" it constabtly says "false". Arghhhhhhhhhhhhhhhhh<BR><BR> Dim i as integer<BR> Dim _item as DataGridItem<BR> For i = 0 to ShowMods.Items.Count-1<BR> _item = ShowMods.items(i)<BR> Dim ApprBox as CheckBox = CTYPE(_item.FindControl("appr"), Checkbox)<BR> response.write (ApprBox.checked)<BR> response.write("<BR>")<BR> If ApprBox.checked then<BR> response.write("yes" & "<BR>")<BR> End If<BR> NEXT
