I am trying to edit a checkbox in a grid on a popup edit form and can not seem to get acces to the control I need. The basic layout is I have a page with a RadGrid. The grid has a popup edit form that has a few controls (labels and textboxes) and a new grid that is populated when you edit the parent grid. On editing the parent I get primay key from the ItemDatabound if the item is in edit mode and is a grid editform item. I then
run my query to populate the child grid with the selected details I desire.
I am trying to allow a user to check or uncheck a checkbox that I then use to update a value in the database. I can access the underlying object in the itemcommand on the update by getting a reference to the grid and they getting the EditItems to then iterate through each GridItem. I have AllowMultiEdit set on my child grid and on the child grid pre_render I set each row to edit mode.What I don't have though is the checkbox control. If I try and do a find control on the child grid in the Editform I get a null back.
Here is a snippet of how I am defining the checkbox on the child grid:
In my UpdateCommand I tried accessing the checkbox with this:
Any suggestions on how I can access the checkbox on my child grid in my edit popup?
run my query to populate the child grid with the selected details I desire.
I am trying to allow a user to check or uncheck a checkbox that I then use to update a value in the database. I can access the underlying object in the itemcommand on the update by getting a reference to the grid and they getting the EditItems to then iterate through each GridItem. I have AllowMultiEdit set on my child grid and on the child grid pre_render I set each row to edit mode.What I don't have though is the checkbox control. If I try and do a find control on the child grid in the Editform I get a null back.
Here is a snippet of how I am defining the checkbox on the child grid:
<EditFormSettings EditFormType="Template"> <PopUpSettings Width="800" Height="500" /> <FormTemplate> ... <telerik:GridTemplateColumn UniqueName="chkResubmitted"> <HeaderTemplate> <asp:CheckBox id="headerChkbox" OnCheckedChanged="ToggleSelectedState" AutoPostBack="True" runat="server" Text=" resubmitted" ></asp:CheckBox> </HeaderTemplate> <EditItemTemplate> <asp:CheckBox id="chkResubmittedEdit" runat="server" /> </EditItemTemplate> <ItemTemplate> <asp:CheckBox id="chkResubmittedItem" OnCheckedChanged="ToggleRowSelection" AutoPostBack="True" runat="server"></asp:CheckBox> </ItemTemplate> </telerik:GridTemplateColumn>In my UpdateCommand I tried accessing the checkbox with this:
if (e.CommandName == RadGrid.UpdateCommandName) { GridEditableItem editedItem = e.Item as GridEditableItem; RadGrid dtlgrid = (editedItem.FindControl("grdClaimDetail") as RadGrid); CheckBox chk = dtlgrid.FindControl("chkResubmittedEdit"); ...Any suggestions on how I can access the checkbox on my child grid in my edit popup?