I have a GridView in ASP.net where I have a CheckBox column. The user can toggle the CheckBox. Now, what I want is that when the user clicks on a button, all the records from the GridView where the CheckBox is checked should be displayed. And on another button, the opposite state should be displayed…
I am not getting the logic for the same.
Can anyone please help me with the logic..
You could iterate through the
GridViewRows and check if theCheckBoxis checked using something like the followingEdit from comments, fixed small bugs. Thanks guys. (3/20/2013):
The index is going to be the column number starting from 0, going left to right of which column holds the
CheckBox. You need to make sure theCheckBoxhas an ID name which is used at CheckBoxName. If you don’t have an ID for that, you can also use