Checkbox State in Datagrid Paging
Hi All,
In my application I have one Datagrid with a checkbox column, I want to maintain the checkbox checked state in the Paging of the datagrid and want to delete if the checkbox is checked.
Thanks in Advance....
Printable View
Checkbox State in Datagrid Paging
Hi All,
In my application I have one Datagrid with a checkbox column, I want to maintain the checkbox checked state in the Paging of the datagrid and want to delete if the checkbox is checked.
Thanks in Advance....
Hey,
How many rows do you return in a page?
Can you not apply the changes each time a "page" is requested, rather than keeps track of all the checkboxes across mulitple "pages"?
Gary
Hi Gary,
10 rows perpage, Want to keep all the checkbox state in the datagrid.
Tell me what to do next........
Hey,
If you are going to continue down this route, then I would suggest that you take a look here:
http://www.codeproject.com/KB/webfor...heckBoxes.aspx
Hope that helps!!
Gary
Hi Gary,
As you told I refered the link and I changed the Datagrid control to Gridview,
But I have master page for my contentpage where the gridview is placed, so while postback the entire grid getting refresh so its again seems unchecked,
Tell me what to do for that when we have a master page and how can we proceed further.
Thanks for your reply.....
Hey,
Unless I have missed something in that article, I don't see why the addition of a Master Page would cause any problems.
I would suggest, if you haven't already, do the article from start to finish as a separate application, get it working, and then port it into your existing application.
Gary
Hi Gary,
I done it as a separate project and checked in all ways then only I added it to my project but while when we going to use it with the master page then it will automatically clearing all the values to load the checkboc status.
Thanks for your reply...
Give more solutions.
Hey,
I am not sure if another solution is required, but rather to find out what is wrong with this one.
Have you been able to isolate where is isn't working? Have you traced to code path to see where it is falling over?
Gary
Can you show the code where you are storing the checked values in hidden variable and the code where you expect it to be present but don't find it? I've implemented this approach (not exactly from the article) and has never encountered an issue.
If your gridview is within update panel and the hidden field is outside the update panel then the values may not appear at Page Load even if you are assigning values on page index change. Is that the case?