Home All Groups Group Topic Archive Search About
Author
4 Jan 2006 4:47 PM
SteveR
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

Author
4 Jan 2006 8:11 PM
Phillip Williams
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.
Show quoteHide quote
"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