views:

1706

answers:

2

According to the VS 2008 properties for a GridView:

  • DataBound fires after the control has been databound.
  • RowDataBound fires after a row has been databound.

If I want to manipulate the text in a header column, does it matter if I use the DataBound or RowDataBound because I can always just check the e.Row.RowType. Is there an actual difference besides the obvious?

+3  A: 

DataBound happens after each and every RowDataBound event is fired, and therefore only fires once for the control. If you only have one thing to do, put it in the DataBound method. If it's something that needs to happen on an arbitrary row, do it in RowDataBound.

Robert C. Barth
Ah. It makes more sense now that you mentioned it like that.
Xaisoft
+1  A: 

You're looking to customize something within a single row. I'd use RowDataBound.

Kon