Click here to Skip to main content
14,740,378 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
I have a parent Gridview and in each row have a gridview childrent have pagging.

When parent Gridview in pageindex = 0, paging of gridview childrent is working. BUT, parent Gridview have pageindex != 0, paging of gridview childrent not working.

Here is my gridview:

<asp:GridView AllowPaging="true" ID="grvReport">
       <asp:GridView AllowPaging="true" ID="grdDetail" OnPageIndexChanging="grdDetail_PageIndexChanging">
               //Some control

What I have tried:

protected void grdDetail_PageIndexChanging(object sender, GridViewPageEventArgs e)
  GetData(new Pager(int.MaxValue, 0));
  BA_WebGPS.UIL.Controls.GridView grvDetail = (sender as BA_WebGPS.UIL.Controls.GridView);
  int rowIndex = ((GridViewRow)grvDetail.Parent.Parent.Parent).RowIndex;
  GridIndexDetail = rowIndex;
  long vehicleID = long.Parse(grvReport.DataKeys[rowIndex].Value.ToString());
  grvDetail.PageIndex = e.NewPageIndex;
  grvDetail.DataSource = BaseManager.LstFullDataDetail.Where(x => x.VehicleID == vehicleID).ToList();

Updated 15-Jul-20 1:16am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900