I have a data centric application with 1000s of records. I have a gridview retrieving data via an object data source with a page size of 500. There are times when a user wants to access all records across all gridview pages. I made a checkbox in gridview with a default checked, whenever user wants to carry out operations on multiple records (export to excel, add note etc) they just check all rows and perform action. What I realised recently however was that these operations don’t work across gridview pages. My code is as follows:
for (int i = 0; i < gvContacts.Rows.Count; i++)
CheckBox cbSelectAll = (CheckBox)gvContacts.Rows[i].FindControl("cbSelectAll");
//do some action if checked
So the problem is not to access all records of gridview, the problem is to access all records checked across pages. How could I solve it? Please help.