Hi
I have a problem for Selection of all rows of a grid while paging is true.
ex. page size=2
In foreach(GridviewRow gr in gridname.Rows)
here the gridname.Rows of count is 2 so how can i get the total rows of grid?
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Jul 5, 2012, 10:36 PM EDT
Please refer the below links
http://www.highoncoding.com/Videos/697_Persisting_CheckBox_State_While_Paging_in_GridView_Control.aspx
http://technico.qnownow.com/2012/05/21/select-all-rows-when-paging-is-enabled-in-asp-net-gridview-control/
http://www.aspsnippets.com/Articles/Bulk-delete-multiple-rows-in-ASPNet-Gridview-control-using-CheckBoxes.aspx
Thanks
If this post helps you mark it as answer
Rahul Bhatt165 reputationPosted Jul 5, 2012, 10:51 PM EDT
To achieve this task,
when you check Select All , at this call server side event of CheckBox Change Event and Set Auto Postback property True,
On check change event,
Set Gridview Allow paging False,
And Bind GridView Again,
Using this you can get All Item in Page
Hemant KumarRank #1,202 · 1.5K reputationPosted Jul 6, 2012, 2:32 AM EDT
Refer this link
http://sdevireddy.wordpress.com/2009/04/11/maintaining-state-of-checkboxes-in-a-gridview-with-paging/
Rahul Bhatt165 reputationPosted Jul 8, 2012, 10:06 PM EDT