problem in getting all rows of gridview when paging is true

Posted by Rickeybglr under ASP.NET on 5/25/2013 | Points: 10 | Views : 4220 | Status : [Member] | Replies : 1
Hi All,

i have a gridview with 1000 of rows and textbox, and checkbox , so i did allowpaging =true. now i want to traverse all the rows and get value of checked textbox.
but if i do somethn like ths foreach (GridViewRow gvrow in gridview1.Rows) it only traverse current page.
so i have done like this:
gridview1.AllowPaging = false;
/// do stuff
gridview1.AllowPaging = true;

but the problem is tht i cannot retain my textbox value.
could somebody help me, stuck badly


Posted by: Pawansoftit on: 5/25/2013 [Member] Starter | Points: 25

If you want that that the values or the rows which you have selected and then if you go to the next page, you should be able to get the previous page selected records, then you need to stores those selected row keys in some where either in dataset or data table and then when you move to the next page, you need to carry the previous datatable records.
Like this you can select as many rows and add to the datatable each time to get all the selected records at the end.
Hope it will be helpful to you.

Pawan Awasthi
+91 8123489140(WhatsApp)

Rickeybglr, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response