This is a migrated thread and some comments may be shown as answers.

CRUD operations on RadGrid nested inside a GridTemplateColumn of another RadGrid

1 Answer 67 Views
Grid
This is a migrated thread and some comments may be shown as answers.
ck
Top achievements
Rank 1
ck asked on 20 Jan 2015, 04:49 PM
<telerik:RadGrid ID="grdLogframe" OnNeedDataSource="grdLogframe_NeedDataSource" <br>                    OnItemDataBound="grdLogframe_ItemDataBound" OnPreRender="grdLogframe_PreRender" runat="server" AutoGenerateColumns="false"><br>                    <MasterTableView DataKeyNames="NodeID" Name="tblLogframe"><br>                        <Columns><br>                            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"></telerik:GridEditCommandColumn><br>                            <telerik:GridBoundColumn UniqueName="NodeID" DataField="NodeID" Visible="false"></telerik:GridBoundColumn><br>                            <telerik:GridTemplateColumn UniqueName="NodeText" DataField="NodeText" HeaderText="Objectives"><br>                                <ItemTemplate><br>                                    <%# Eval("ProjectLogframeNodeType.NodeTypeName") %>&nbsp;:&nbsp;<%# Eval("NodeText") %><br>                                </ItemTemplate><br>                            </telerik:GridTemplateColumn><br>                            <telerik:GridTemplateColumn UniqueName="indicators"><br>                                <itemtemplate><br>                                       <telerik:RadGrid ID="grdIndicators" runat="server" AutoGenerateColumns="false" ShowHeader="true" OnPreRender="grdIndicators_PreRender" OnItemCreated="grdIndicators_ItemCreated" OnItemDataBound="grdIndicators_ItemDataBound"><br>                                           <MasterTableView DataKeyNames="ProjectLogframeIndicatorID" <br>                                               NoMasterRecordsText ="Indicators not defined yet" Name="tblIndicators"><br>                                               <Columns><br>                                                   <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"></telerik:GridEditCommandColumn><br>                                                   <telerik:GridBoundColumn HeaderText="Project Indicators" UniqueName="Description" DataField="Description"></telerik:GridBoundColumn><br>                                                   <telerik:GridBoundColumn HeaderText="Corporate Indicators" UniqueName="CorpResultFrameworkIndicatorID" DataField="CorpResultFrameworkIndicatorID"></telerik:GridBoundColumn><br>                                                   <telerik:GridBoundColumn HeaderText="Programme Indicators" UniqueName="ProgrameIndicatorID" DataField="ProgrameIndicatorID"></telerik:GridBoundColumn><br>                                                   <telerik:GridBoundColumn HeaderText="Baseline" UniqueName="Baseline" DataField="Baseline"></telerik:GridBoundColumn><br>                                                   <telerik:GridBoundColumn HeaderText="Targets" UniqueName="Targets" DataField="Targets"></telerik:GridBoundColumn><br>                                                   <telerik:GridBoundColumn HeaderText="Means of Verifications" UniqueName="MeansOfVerification" DataField="MeansOfVerification"></telerik:GridBoundColumn><br>                                               </Columns><br>                                               <CommandItemSettings AddNewRecordText="Add Indicator" AddNewRecordImageUrl="../Img/insert.png" /><br>                                           </MasterTableView><br>                                       </telerik:RadGrid><br>                                </itemtemplate><br>                            </telerik:GridTemplateColumn>
...

I am doing the nested grid binding inside the item created of the outer grid.
the issue is with the CRUD operations on the inner grids, whenever they post back the whole grid structure is recreated and the post back event is lost.
This is manifested specifically with the InitInsert and InitUpdate commands on inner grids. the grid refreshes but the action is lost.

how can i perform this?

thank you

1 Answer, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 23 Jan 2015, 09:38 AM
Hello,

From the code it does not become clear how is the child grid populated. Note that if it uses simple data-binding it is expected for a command to not fire. That said please ensure that advanced data-binding is used for the child grid as well.

If the grdIndicators grid is already configured in such a way please share with us the entire page contents so we could further research the matter.

Regards,
Angel Petrov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
ck
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Share this question
or