470,614 Members | 1,556 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,614 developers. It's quick & easy.

checkbox always "false" in GridView

i have this in the html view:
<asp:TemplateField HeaderText ="Remove?">
<ItemTemplate>
<asp:CheckBox ID="removeSelect1" runat="server" />
</ItemTemplate>
<HeaderTemplate>
</HeaderTemplate>
<HeaderStyle ForeColor="White" />
</asp:TemplateField>

and this in my c# file:
foreach (GridViewRow row in GridView2.Rows)
{
bool isChecked = ((CheckBox)row.FindControl("removeSelect1")).Check ed;
}

isChecked is always "false" even when checked. Any help is
appreciated.
Thanks,
Trint

Apr 17 '07 #1
1 5234
On Apr 17, 2:46 pm, trint <trinity.sm...@gmail.comwrote:
i have this in the html view:
<asp:TemplateField HeaderText ="Remove?">
<ItemTemplate>
<asp:CheckBox ID="removeSelect1" runat="server" />
</ItemTemplate>
<HeaderTemplate>
</HeaderTemplate>
<HeaderStyle ForeColor="White" />
</asp:TemplateField>

and this in my c# file:
foreach (GridViewRow row in GridView2.Rows)
{
bool isChecked = ((CheckBox)row.FindControl("removeSelect1")).Check ed;

}

isChecked is always "false" even when checked. Any help is
appreciated.
Thanks,Trint
Nevermind. I figured it out. On the GridView, all I did to make it
read the checkbox was EnableViewState to False.
Trint

Apr 18 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by renderman | last post: by
1 post views Thread by Andrew Robinson | last post: by
30 posts views Thread by Brian | last post: by
2 posts views Thread by Gilbert Tordeur | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.