This is my second post with regards to the issue that I am facing with Hierarchical Grid. Sorry for reposting it, but I thought it would be better to explain my problem again with the sample code.
I have a hierarchical RadGrid, where both the parent and the child table records can be updated. The issue is with the "Edit Selected" button of the child table. When the user clicks on any page other than page 1 of the child table and then selects any item(s) for edit using "Edit Selected Items" command button, the records that are shown in edit mode are from page no. 1 and not the actual one that were selected. At the same time the individual "Edit" button for each record on the child control work fine. So I am not very sure why "Edit Selected" option is not working.
To demostrate my problem I have created a simple sample page and I am attaching the code for the same (This page doesn’t have the code to actually the update the records as I was just testing the “Edit Selected” option).
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadGrid1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadGrid1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<div>
<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" GridLines="None"
AutoGenerateEditColumn="true" AllowMultiRowEdit="true" AllowMultiRowSelection="true"
PagerStyle-Mode="NextPrevAndNumeric">
<MasterTableView AutoGenerateColumns="True" DataSourceID="SqlDataSource1" DataKeyNames="CategoryID"
Name="MasterTableView" CommandItemDisplay="Top" PageSize="3" AllowPaging="true">
<CommandItemTemplate>
<asp:LinkButton Style="vertical-align: bottom" ID="btnEditSelected1" runat="server"
CommandName="EditSelected" CausesValidation="false" Visible='<%# RadGrid1.EditIndexes.Count == 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="../Include/Images/Edit.gif" /> Edit Selected Records</asp:LinkButton>
<asp:LinkButton ID="btnCancel1" runat="server" CommandName="CancelAll" CausesValidation="false"
Visible='<%# (RadGrid1.EditIndexes.Count > 0 || RadGrid1.MasterTableView.IsItemInserted) %>'><img style="border:0px;vertical-align:middle;" alt="" src="../Include/Images/Cancel.gif" /> Cancel editing</asp:LinkButton>
</CommandItemTemplate>
<DetailTables>
<telerik:GridTableView DataKeyNames="CategoryID" AutoGenerateColumns="true" DataSourceID="SqlDataSource2"
CommandItemDisplay="Top" AllowPaging="true" PageSize="3">
<CommandItemTemplate>
<asp:LinkButton Style="vertical-align: bottom" ID="btnEditSelected" runat="server"
CommandName="EditSelected" CausesValidation="false" Visible='<%# RadGrid1.EditIndexes.Count == 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="../Include/Images/Edit.gif" /> Edit Selected Records</asp:LinkButton>
<asp:LinkButton ID="btnCancel" runat="server" CommandName="CancelAll" CausesValidation="false"
Visible='<%# (RadGrid1.EditIndexes.Count > 0 || RadGrid1.MasterTableView.IsItemInserted) %>'><img style="border:0px;vertical-align:middle;" alt="" src="../Include/Images/Cancel.gif" /> Cancel editing</asp:LinkButton>
</CommandItemTemplate>
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="CategoryID" MasterKeyField="CategoryID" />
</ParentTableRelation>
</telerik:GridTableView>
</DetailTables>
</MasterTableView>
<ClientSettings>
<Selecting AllowRowSelect="true" />
</ClientSettings>
</telerik:RadGrid>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT * FROM [Categories]"></asp:SqlDataSource>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
SelectCommand="SELECT * FROM [Products] WHERE ([CategoryID] = @CategoryID)">
<SelectParameters>
<asp:Parameter Name="CategoryID" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>
</div>
</form>
Thank you for your time.
Best Regards,
Rajiv