Hi...
I have a gridview for employee details used in my aspx page. At first am binding the gridview from database or by importing an excel file. I have used allowpaging property and my page size is 10 records. on going to second page of grid do i need to call the database call again or any other method is there. And also am using two columns as template fields so will page index changing work.
How can we pass database values to gridview data key names also.
Thanks and Regards
Sankar
Cochin
sankar nandakumaranPosted Jul 27, 2012, 5:50 AM
I have tried this already but its not working . First time on loading can we store the dataset to ViewState and then call the datasource as view state in paging. Or any other solution is there rather than going each time to fetch the data.
gvAgentList.PageIndex = e.NewPageIndex;
gvAgentList.DataBind();
This code is not working as on post back the datasource is getting null.
Thanks and Regards
Sankar
Atul KumarPosted Jul 26, 2012, 8:02 AM
protected void gvAgentList_PageIndexChanging
(object sender, GridViewPageEventArgs e)
{
gvAgentList.PageIndex = e.NewPageIndex;
gvAgentList.DataBind();
}