griddview pageIndexChanged() event
-
i have grid view in which i have allow paging.......so i have 10 pages.123456789...n so on to get all pages i hv write the code as follwes. protected void grdvwUpdt_PageIndexChanging(object sender, GridViewPageEventArgs e) { DataTable dsAllUpdtblData = ViewState["dvAllUpdtblData"] as DataTable; grdvwUpdt.PageIndex = e.NewPageIndex; grdvwUpdt.DataSource = dsAllUpdtblData; grdvwUpdt.DataBind(); } when i click on any no ....it dnt show any change.....it must hv to give remaining record...but it didnt shoe tht why?
-
i have grid view in which i have allow paging.......so i have 10 pages.123456789...n so on to get all pages i hv write the code as follwes. protected void grdvwUpdt_PageIndexChanging(object sender, GridViewPageEventArgs e) { DataTable dsAllUpdtblData = ViewState["dvAllUpdtblData"] as DataTable; grdvwUpdt.PageIndex = e.NewPageIndex; grdvwUpdt.DataSource = dsAllUpdtblData; grdvwUpdt.DataBind(); } when i click on any no ....it dnt show any change.....it must hv to give remaining record...but it didnt shoe tht why?
In page Index Changing no need to rebind gridview. Only this much is enough grdvwUpdt.PageIndex = e.NewPageIndex;
-
In page Index Changing no need to rebind gridview. Only this much is enough grdvwUpdt.PageIndex = e.NewPageIndex;
-
You use your earlier code.That is rebind the grid after changing the page index and insert breakpoints .Check whether control is passing correctly or not.
-
You use your earlier code.That is rebind the grid after changing the page index and insert breakpoints .Check whether control is passing correctly or not.
-
i have grid view in which i have allow paging.......so i have 10 pages.123456789...n so on to get all pages i hv write the code as follwes. protected void grdvwUpdt_PageIndexChanging(object sender, GridViewPageEventArgs e) { DataTable dsAllUpdtblData = ViewState["dvAllUpdtblData"] as DataTable; grdvwUpdt.PageIndex = e.NewPageIndex; grdvwUpdt.DataSource = dsAllUpdtblData; grdvwUpdt.DataBind(); } when i click on any no ....it dnt show any change.....it must hv to give remaining record...but it didnt shoe tht why?
Here is the code. You need to create the session of the gridview at the time of binding the data public void BindData() { DataSet dsItemList = objConfig.GetItemList(); grdItemList.DataSource = dsItemList; grdItemList.DataBind(); Session["grd_ItemList"] = dsItemList; } After creating the session use that session in ur page indexchanging method protected void grdItemList_PageIndexChanging(object sender, GridViewPageEventArgs e) { grdItemList.PageIndex = e.NewPageIndex; if (Session["grd_ItemList"] != null) { grdItemList.DataSource = Session["grd_ItemList"]; grdItemList.DataBind(); } Session["grd_ItemList"] = null;//end the session }