System.Web.UI.WebControls Namespace GridView Class
.NET Framework version 2.0
Occurs after a row in the GridView is data-bound but before it is rendered on the page.
[ VB ]
Public Event RowDataBound As GridViewRowEventHandler
[ C# ]
public event GridViewRowEventHandler RowDataBound;
[ C++ ]
public: __event GridViewRowEventHandler* RowDataBound;
In [ JScript ], you can handle the events defined by a class, but you cannot define your own.
The RowDataBound event is raised whenever a row in the GridView is bound to data.
This event provides an opportunity to access each row before the page is finally sent to the client for display. After this event is raised, the data item is nulled out and no longer available.
This event is raised for the header, the footer, and data rows.
Information related to the RowDataBound event is passed via a GridViewRowEventArgs object to the method assigned to handle the event. The following GridViewRowEventArgs property provides information specific to this event.
Property |
Description |
Row |
Gets the GridViewRow associated with the event. |
The below snippet shows how to attach a handler for the RowDataBound event.
<asp:gridview id = "myGridView" runat = "server"
onRowDataBound = "doWhatever" ... >
The following examples demonstrate how to code a handler for the RowDataBound event of a GridView control in different scenarios.
GridView Members RowCreated GridViewRowEventArgs