DataGrid paging-- OnItemCommand not respecting page number?

Discussion in 'ASP .Net Datagrid Control' started by Steve Hershoff, Aug 9, 2006.

  1. Hi everyone,

    I'm using the paging feature in the DataGrid class for the first time, and
    am having some trouble.

    I have an asp button column in the DataGrid, and when I click on it my
    OnItemCommand function fires just fine-- but for some reason the
    DataGridCommandEventArgs parameter always thinks it's on the first page.

    Say, for instance, I'm on page 33 of my DataGrid and I click the button
    column in one of the records. The DataGridCommandEventArgs parameter, which
    I call "e", should a value of 222 in cell[0]. Instead, I get a value of
    111, which is the value from the corresponding record on page #1.

    What am I doing wrong here? I'm letting the DataGrid handle the gritty
    details itself--no custom paging from me-- yet the value of
    e.Item.Cells[0].Text comes from page #1 no matter what page I'm on. As you
    might guess, I'm a newbie when it comes to DataGrid paging so any advice you
    have I'd be grateful for. Thanks!
    Steve Hershoff, Aug 9, 2006
    #1
    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. Rick White
    Replies:
    1
    Views:
    1,581
    Natty Gur
    Jan 13, 2004
  2. Steve Hershoff
    Replies:
    0
    Views:
    390
    Steve Hershoff
    Aug 9, 2006
  3. R. David Murray
    Replies:
    8
    Views:
    579
    Tim Chase
    Mar 27, 2009
  4. Sonal

    datagrid onitemcommand not firing

    Sonal, Oct 29, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    158
    Sushila [MVP]
    Oct 30, 2004
  5. Sink

    OnItemCommand and Paging in DataGrid

    Sink, Nov 28, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    103
Loading...

Share This Page