tricky runtime error-trying to get row index

Discussion in 'ASP .Net' started by Paul, May 21, 2008.

  1. Paul

    Paul Guest

    Hi, just wondering if anyone knows how to solve this runtime error as I am
    trying to just get the row number of the selected delete command on a
    gridview.

    Index was out of range. Must be non-negative and less than the size of the
    collection.
    Parameter name: index

    when running
    protected void gridview_RowDeleting(object sender, GridViewDeleteEventArgs e)
    {//row deleting event
    int rowID = (int)gridview.DataKeys[e.RowIndex].Value ;
    }


    --
    Paul G
    Software engineer.
    Paul, May 21, 2008
    #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. Replies:
    9
    Views:
    517
    CBFalconer
    Apr 25, 2006
  2. troutbum

    Cannot Find Row Index after using row filter

    troutbum, Jan 22, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    10
    Views:
    457
    Andre
    Feb 19, 2004
  3. sauce
    Replies:
    0
    Views:
    219
    sauce
    Apr 12, 2005
  4. Ana Lindt
    Replies:
    1
    Views:
    118
    Ana Lindt
    May 31, 2004
  5. Tomasz Chmielewski

    sorting index-15, index-9, index-110 "the human way"?

    Tomasz Chmielewski, Mar 4, 2008, in forum: Perl Misc
    Replies:
    4
    Views:
    256
    Tomasz Chmielewski
    Mar 4, 2008
Loading...

Share This Page