I am using an SPGridView in which I have put paging and filtering facility. But whenever I change the page and then do filtering, the paging disappears.

How can I correct this?


You need to again specify pagination in page index change event.


public void gdSharedReport_PageIndexChanging(object sender, GridViewPageEventArgs e)
     gdSharedReport.PageIndex = e.NewPageIndex;
     gdSharedReport.AllowPaging = true;
     gdSharedReport.PageIndexChanging += new GridViewPageEventHandler(gdSharedReport_PageIndexChanging);
     gdSharedReport.PagerTemplate = null;
     gdSharedReport.DataSource = DataTable;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.