Results 1 to 11 of 11

Thread: Checkbox State in Datagrid Paging

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2008
    Posts
    268

    Question Checkbox State in Datagrid Paging

    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....

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Checkbox State in Datagrid Paging

    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

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2008
    Posts
    268

    Question Re: Checkbox State in Datagrid Paging

    Hi Gary,

    10 rows perpage, Want to keep all the checkbox state in the datagrid.

    Tell me what to do next........

  4. #4
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Checkbox State in Datagrid Paging

    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

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2008
    Posts
    268

    Question Re: Checkbox State in Datagrid Paging

    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.....

  6. #6
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Checkbox State in Datagrid Paging

    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

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2008
    Posts
    268

    Question Re: Checkbox State in Datagrid Paging

    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.

  8. #8
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Checkbox State in Datagrid Paging

    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

  9. #9
    Fanatic Member
    Join Date
    Jun 2004
    Location
    All useless places
    Posts
    917

    Re: Checkbox State in Datagrid Paging

    Quote Originally Posted by sarathi125 View Post
    ...when we going to use it with the master page then it will automatically clearing all the values to load the checkboc status.
    What values are being cleared? GridView data or ids stored in hidden field?

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2008
    Posts
    268

    Question Re: Checkbox State in Datagrid Paging

    Quote Originally Posted by rjv_rnjn View Post
    What values are being cleared? GridView data or ids stored in hidden field?
    Hi,

    IDs which are stored in the HiddenField, need to get back after the master page and content page load, then only can possible to make the gridview checkbox states as checked....

    Thanks for your reply.

  11. #11
    Fanatic Member
    Join Date
    Jun 2004
    Location
    All useless places
    Posts
    917

    Re: Checkbox State in Datagrid Paging

    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width