asp.net.ph

GridView.RowDataBound Event

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.

Remarks

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.

Event Data

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.

Example

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.

Dynamically Generated ButtonField ImageButtons
Run Sample | View Source
GridView RowDataBound Event Example
Run Sample | View Source
Dynamically Generated HyperLinkField Images
Run Sample | View Source
See Also

GridView Members   RowCreated   GridViewRowEventArgs Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph