Paging in Nested grid collapses the panel - Asp.net

Posted by Sharpcnet under ASP.NET on 10/15/2014 | Points: 10 | Views : 1120 | Status : [Member] | Replies : 0
I have a nested gridview. Each row for the main grid has an icon to expand/collapse its inner grid. When browisng the pages in the inner grid, it collapses the div each time. So user has to click the main grids icon again to see the next page of the inner grid.

What should be done so that the div doesnt collapse when paging the inner grid.

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="gvSummary" EventName="PageIndexChanging" />
</Triggers>
<ContentTemplate>

<div id="divInner">
<asp:GridView ID="gvSummary" runat="server" AutoGenerateColumns="False"
OnRowDataBound="gvSummary_RowDataBound" DataKeyNames="URL">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:UpdatePanel ID="UpdatePanel2" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="gvDetails"
EventName="PageIndexChanging"/>
</Triggers>
<ContentTemplate>
<asp:GridView ID="gvDetails" runat="server" AutoGenerateColumns="false"
DataKeyNames="URL">
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>

protected void gvDetails_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView gvDetails = (sender as GridView);
gvDetails.PageIndex = e.NewPageIndex;
string sUrl = gvDetails.DataKeys[0].Value.ToString().Trim();
gvDetails.DataSource = GetFeedbackDetailsByUrl(sUrl);
gvDetails.DataBind();
//UpdatePanel1.Update(); having this did not work
}





Responses

(No response found.)

Login to post response