RowDataBound?
When to use RowDataBound?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Sep 23, 2013, 1:54 AM
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.
Sanjeeb LenkaPosted Sep 21, 2013, 2:49 PM
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