GridViewRowEventArgs Class
TOC
Collapse the table of content
Expand the table of content

GridViewRowEventArgs Class

 

Provides data for the RowCreated and RowDataBound events.

Namespace:   System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)

System.Object
  System.EventArgs
    System.Web.UI.WebControls.GridViewRowEventArgs

type GridViewRowEventArgs = 
    class
        inherit EventArgs
    end

NameDescription
System_CAPS_pubmethodGridViewRowEventArgs(GridViewRow)

Initializes a new instance of the GridViewRowEventArgs class.

NameDescription
System_CAPS_pubpropertyRow

Gets the row being created or data-bound.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

Before the GridView control can be rendered, a GridViewRow object must be created for each row in the control. The RowCreated event is raised each time a row in the GridView control is created. This allows you to provide an event-handling method that performs a custom routine, such as adding custom content to a row, whenever this event occurs.

Similarly, each row in the control must be bound to a record in the data source before the GridView control can be rendered. The RowDataBound event is raised when a data row (represented by a GridViewRow object) is bound to data in the GridView control. This allows you to provide an event-handling method that performs a custom routine, such as modifying the values of the data bound to the row, whenever this event occurs.

A GridViewRowEventArgs object is passed to the event-handling method, which allows you to access the properties of the row that raised the event. To access a specific cell in the row, use the Cells property of the GridViewRow object contained in the Row property. You can also determine which row type (header row, data row, and so on) is being created by using the RowType property of the GridViewRow object.

For more information about handling events, see NIB: Consuming Events.

For a list of initial property values for an instance of GridViewRowEventArgs, see the GridViewRowEventArgs constructor.

The following example demonstrates how to use the GridViewRowEventArgs object passed to the event-handling method to access the properties of the row being bound to data.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft