GridViewCommandEventArgs Class
Provides data for the RowCommand event.
System::EventArgs
System.Web.UI.WebControls::CommandEventArgs
System.Web.UI.WebControls::GridViewCommandEventArgs
Assembly: System.Web (in System.Web.dll)
The GridViewCommandEventArgs type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | GridViewCommandEventArgs(Object, CommandEventArgs) | Initializes a new instance of the GridViewCommandEventArgs class using the specified source of the command and event arguments. |
![]() | GridViewCommandEventArgs(GridViewRow, Object, CommandEventArgs) | Initializes a new instance of the GridViewCommandEventArgs class using the specified row, source of the command, and event arguments. |
| Name | Description | |
|---|---|---|
![]() | CommandArgument | Gets the argument for the command. (Inherited from CommandEventArgs.) |
![]() | CommandName | Gets the name of the command. (Inherited from CommandEventArgs.) |
![]() | CommandSource | Gets the source of the command. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
The RowCommand event is raised when a button within the GridView control is clicked. This allows you to provide an event-handling method that performs a custom routine whenever this event occurs.
Note |
|---|
The GridView control also raises other specialized events when certain buttons are clicked (buttons with the CommandName property set to "Delete", "Update", and "Page" for example). When using one of these buttons, you should consider handling one of the specialized events provided by the control (such as RowDeleted or RowDeleting). |
A GridViewCommandEventArgs object is passed to the event-handling method, which allows you to determine the command name and command argument of the button clicked. To determine the command name and command argument, use the CommandName and CommandArgument properties, respectively. You can also access the button control that raised the event by using the CommandSource property.
For more information about handling events, see Consuming Events.
For a list of initial property values for an instance of GridViewCommandEventArgs, see the GridViewCommandEventArgs constructor.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.



Note