I have doubt about the Row_DataBound
and Row_Created
events :
What is the difference between Row_DataBound
and Row_Created
events?
What are the parameters for choosing between these two events?
RowCreated occurs after a row and all of its child controls are created.
RowDataBound occurs after the row (and its controls) are databound, i.e. populated with the data values.
The answer about which to use really depends on if you need the databound values or not. e.g. If you wanted to change the background color of your row based the value of one of your fields, then you would have to use the RowDataBound event. If your logic doesn't depend on the data, then I don't think it matters which event you use.
An example of where you would have to use RowCreated is if you had a drop down list in your row that would need to be popluated with values before the selected value was databound.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With