This one is driving me insane and is probably a simple fix. All i'm trying to do is foreach(griditem) and if that control is checked process it on a button click, but all the checkboxes are false.
The GridView is created using AutoGenerateColumns, however in the aspx I push a checkbox column in before hand. Everything looks great just this always false is kiling me.
foreach (GridDataItem gdItem in RoleNamePageNameAddGrid.MasterTableView.Items)
{
CheckBox chk = (CheckBox)gdItem.FindControl("CheckBoxAdd") as CheckBox;
if(chk.Checked == true)
{
}
}
<telerik:RadGrid ID="RoleNamePageNameAddGrid" runat="server">
<MasterTableView DataKeyNames="PageDefn">
<Columns>
<telerik:GridTemplateColumn HeaderText="Update">
<ItemTemplate>
<asp:CheckBox ID="CheckBoxAdd" runat="server" AutoPostBack="false" />
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
<telerik:RadButton ID="AddPageRoleAttachmentButton" runat="server" Text="Add" OnClick="AddPageRoleAttachmentButton_Click">
</telerik:RadButton>
The GridView is created using AutoGenerateColumns, however in the aspx I push a checkbox column in before hand. Everything looks great just this always false is kiling me.
foreach (GridDataItem gdItem in RoleNamePageNameAddGrid.MasterTableView.Items)
{
CheckBox chk = (CheckBox)gdItem.FindControl("CheckBoxAdd") as CheckBox;
if(chk.Checked == true)
{
}
}
<telerik:RadGrid ID="RoleNamePageNameAddGrid" runat="server">
<MasterTableView DataKeyNames="PageDefn">
<Columns>
<telerik:GridTemplateColumn HeaderText="Update">
<ItemTemplate>
<asp:CheckBox ID="CheckBoxAdd" runat="server" AutoPostBack="false" />
</ItemTemplate>
</telerik:GridTemplateColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
<telerik:RadButton ID="AddPageRoleAttachmentButton" runat="server" Text="Add" OnClick="AddPageRoleAttachmentButton_Click">
</telerik:RadButton>