RowDataBound?
When to use RowDataBound?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Sep 21, 2013, 10:49 AM EDT
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 enables 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 enables 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.
reference
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowdatabound.aspx
Jignesh TrivediRank #16 · 50.3K reputationPosted Sep 22, 2013, 9:54 PM EDT
hi,
whenever you want to manipulate the value row by row in grid view for example on some conditional data you want show grid view row in different color at this time you can use RowDataBount event.
this event if fire at this time of binding the data at row level. It is fired for all rows including header and footer of the grid view....
please refer
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview_events.aspx
hope this will help you.