GridView.RowDataBound Event
Assembly: System.Web (in system.web.dll)
public: event GridViewRowEventHandler^ RowDataBound { void add (GridViewRowEventHandler^ value); void remove (GridViewRowEventHandler^ value); }
/** @event */ public void add_RowDataBound (GridViewRowEventHandler value) /** @event */ public void remove_RowDataBound (GridViewRowEventHandler value)
In JScript, you can handle the events defined by a class, but you cannot define your own.
Not applicable.
Before the GridView control can be rendered, each row in the control must be bound to a record in the data source. 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 being bound. To access a specific cell in the row, use the Cells property of the GridViewRow object contained in the Row property of the GridViewRowEventArgs object. You can determine which row type (header row, data row, and so on) is being bound by using the RowType property.
For more information about handling events, see Consuming Events.
| Topic | Location |
|---|---|
| How to: Set GridView Web Server Control Column Width Dynamically | Building ASP .NET Web Applications |
| How to: Set GridView Web Server Control Column Width Dynamically | Building ASP .NET Web Applications |