RowCommand - item index?

Discussion in 'ASP .Net Web Controls' started by SteveR, Jan 4, 2006.

  1. SteveR

    SteveR Guest

    I've just started experimenting with VS2005. I have a GridView with a command
    button in it. When I click the button the RowCommand event fires but how do I
    find out which row it was that caused it? In VS2003 I used e.Item.ItemIndex
    in the ItemCommand event but e.Item doesn't exist for a RowCommand event.
    --
    Steve
    SteveR, Jan 4, 2006
    #1
    1. Advertising

  2. http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowcommand.aspx
    This is a quote from the above link:

    ' The GridViewCommandEventArgs class does not contain a
    ' property that indicates which row's command button was
    ' clicked. To identify which row's button was clicked, use
    ' the button's CommandArgument property by setting it to the
    ' row's index.
    --
    HTH,
    Phillip Williams
    http://www.societopia.net
    http://www.webswapp.com


    "SteveR" wrote:

    > I've just started experimenting with VS2005. I have a GridView with a command
    > button in it. When I click the button the RowCommand event fires but how do I
    > find out which row it was that caused it? In VS2003 I used e.Item.ItemIndex
    > in the ItemCommand event but e.Item doesn't exist for a RowCommand event.
    > --
    > Steve
    Phillip Williams, Jan 4, 2006
    #2
    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:
    0
    Views:
    5,824
  2. Zule
    Replies:
    1
    Views:
    5,339
  3. keithb
    Replies:
    1
    Views:
    4,304
    PeterKellner
    Jun 10, 2006
  4. Kevin Attard

    GridView RowCommand event not firing!!

    Kevin Attard, Aug 8, 2006, in forum: ASP .Net
    Replies:
    8
    Views:
    31,640
    Lawrence Mucheka
    May 29, 2008
  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:
    279
    Tomasz Chmielewski
    Mar 4, 2008
Loading...

Share This Page