Click here to Skip to main content
15,888,020 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
When selecting rows in gridview who has got pagination , if you click All (Top checkbox), it only gives the selected page ,so you have to go through each page in turn.

I want to create one more checkbox may be outside , which selects all the checkboxes of the all pages of gridview and gives me the result so that i can loop through all the records present inside gridview and not rlated to pertuclar page of gridview
Posted
Updated 13-May-14 23:03pm
v5
Comments
DamithSL 14-May-14 5:50am    
is this read only gridview?

 
Share this answer
 
Comments
Torakami 14-May-14 5:19am    
Not this one ... I dont want to maintain any state .. i simple want to take all records when i click all buttton present outside of gridview .. it will give me all records from all pages at once
Setting this might be of help :-

EnablePersistedSelection="true"
 
Share this answer
 
Comments
Torakami 14-May-14 6:23am    
Can you show example on this .. i didnt get this logic
SRS(The Coder) 14-May-14 6:27am    
This is not a logic, its just a property of the gridview to set and it will take care to persist the selected rows primary key values across pages for the GridView.
you can iterate on your data source, for example; if you bind data using data table

C#
DataTable dt = // from your method call
Session["dt"] =dt;
//bind data to gridview 


When you need to iterate over all the data, you can iterate over Session["dt"], cast it back to DataTable and iterate.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900