Reputation: 185
When to use RowDataBound and RowCreated events in gridview? I needed a example or scenario to clarify difference between them and their context..
Upvotes: 1
Views: 5881
Reputation: 9862
RowCreated event fires when the html-controls for a row are created. For example the controls you specify in templates, such as a text box or a dropdownlist. Data binding has not yet taken place.
RowDataBound event fires when the data row is bound to the data of the GridView. Can be used to do data manipulation based on the custom condition, or do logical function based on the data for each GridViewRow or to alter the UI of each row based on the condition.
If we apply style to apply in RowCreated and RowDataBound evnts. the styles in RowDataBound event is applied why because RowCreated styles are override by RowDataBound event. as well if don't written any style in RowDataBound event then RowCreated Event Style are applicable. As discussed here
Upvotes: 0
Reputation: 1838
Refer the below link..
Difference between rowdatabound and rowcreated..
Upvotes: 1