I use PagedDataSource for custom gridview paging. Here is the code:
PagedDataSource dataSource = new PagedDataSource(); int virtualRowCount = Convert.ToInt32(dataset.Tables[1].Rows[0]["TotalRows"]); dataSource.AllowCustomPaging = true; dataSource.PageSize = 15; dataSource.VirtualCount = virtualRowCount; dataSource.DataSource = dataset.Tables[0].DefaultView; gvTaxPayerLoginDetail.DataSource = dataSource; gvTaxPayerLoginDetail.DataBind();
I return "totals" from my stored procedure (which is set in virtualRowCount) and the actual rows in tables[0] of the data set. I get results, but my pager is gone. The pager is no longer displayed. How can I show gridview to get value from PagedDataSource?
Work with ASP.Net 4
source share