Datagrid Paging Checkbox

Discussion in 'ASP .Net Datagrid Control' started by Arun, Jun 18, 2004.

  1. Arun

    Arun Guest

    Hello,

    I have a problem when we use paging in Datagrid.
    We have checkbox in datagrid. If we go to next page, and come to previous
    page
    the items that had been selected is deselected.

    Since we are inserting into db based on items that are selected, we are
    having problems
    in inserting the records.

    Hope you understand my problem.

    -Thanks
    Arun
    Arun, Jun 18, 2004
    #1
    1. Advertising

  2. I assume that you would be reloading the data from the database during
    postback when moving to a new page. So you will lose the state of the
    previous page. So before you load the data from the Database and
    repopulate the Grid you should reflect the changes into the database, or
    have the dataset in cache/viewstate/session and then change the dataset
    based on the present page setting and then rebind the Grid.

    Trevor Benedict R
    MCSD

    *** Sent via Devdex http://www.devdex.com ***
    Don't just participate in USENET...get rewarded for it!
    Trevor Benedict R, Jun 19, 2004
    #2
    1. Advertising

  3. Hello Arun,

    I was facing same problem, I suppose - not sure -, but it's grid's
    limitations,

    So it's better you keep all Checkbox's status in some ViewState Variable.
    and On ItemDataBound check all CheckBox status before rendering.

    Hope that will help you.

    Harshdeep Mehta
    "Arun" <> wrote in message
    news:...
    > Hello,
    >
    > I have a problem when we use paging in Datagrid.
    > We have checkbox in datagrid. If we go to next page, and come to previous
    > page
    > the items that had been selected is deselected.
    >
    > Since we are inserting into db based on items that are selected, we are
    > having problems
    > in inserting the records.
    >
    > Hope you understand my problem.
    >
    > -Thanks
    > Arun
    >
    >
    >
    >
    Harshdeep Mehta, Jul 19, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. iforsyth

    Paging DataGrid Checkbox Persistence

    iforsyth, Jan 9, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    4,416
    Mike Moore [MSFT]
    Jan 9, 2004
  2. wh1974
    Replies:
    0
    Views:
    2,430
    wh1974
    Jan 12, 2005
  3. Red
    Replies:
    1
    Views:
    715
  4. =?Utf-8?B?RG90TmV0RGV2?=

    DataGrid and embeded Checkbox..How to find if checkbox clicked

    =?Utf-8?B?RG90TmV0RGV2?=, Oct 6, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    806
    David Wier
    Oct 6, 2006
  5. Joey Pang
    Replies:
    4
    Views:
    508
    Joey Pang
    Jun 13, 2005
Loading...

Share This Page