OK, I've been searching for an answer for quite a while now and still, nothing works. I've tried both CheckboxColumn and Template column. In both cases, I can check the box on the form, but when I do a postback, the state is always reported as the default in which I set it.
I'm not doing anything fancy here. All I want is to be able to loop through the records and see if the user checked anything and set up the operation I need to do on that.
Here is the current code:
ASPX:
<radG:GridTemplateColumn UniqueName="cbCol"
HeaderText="Select">
<ItemTemplate>
<asp:CheckBox ID="cbSelection" runat="server" Checked="false" />
</ItemTemplate>
</radG:GridTemplateColumn>
ASPX.CS
protected void ExecuteSubmit(object sender, EventArgs e)
{
foreach (GridDataItem X in RadGrid1.Items)
{
CheckBox ItemSelect = (CheckBox)X["cbCol"].FindControl("cbSelection");
if (ItemSelect.Checked)
{
// NEVER reaches here if checkbox was defaulted to 'unchecked' regardless of the state of the control on postback.
}
}
}
What am I missing?
I'm not doing anything fancy here. All I want is to be able to loop through the records and see if the user checked anything and set up the operation I need to do on that.
Here is the current code:
ASPX:
<radG:GridTemplateColumn UniqueName="cbCol"
HeaderText="Select">
<ItemTemplate>
<asp:CheckBox ID="cbSelection" runat="server" Checked="false" />
</ItemTemplate>
</radG:GridTemplateColumn>
ASPX.CS
protected void ExecuteSubmit(object sender, EventArgs e)
{
foreach (GridDataItem X in RadGrid1.Items)
{
CheckBox ItemSelect = (CheckBox)X["cbCol"].FindControl("cbSelection");
if (ItemSelect.Checked)
{
// NEVER reaches here if checkbox was defaulted to 'unchecked' regardless of the state of the control on postback.
}
}
}
What am I missing?