I have some grid initialization code in the InitializeLayout event of the grid (format columns, change widths, etc.). However, I am running into cases where the InitializeRow event is firing BEFORE the InitializeLayout event. I don't know why this is happening, but I put breakpoints in my code in both events and I can confirm that it does happen.
Is there a better event to use than the InitializeLayout event? I am doing things like column formatting, so it would have to be after the data has been bound, but before the InitializeRow event fires. If there is no better event to use, is there a way to disable the InitializeRow event until the InitializeLayout event has fired?
I can't think of a reason why InitializeRow woudl fire before InitializeLayout, unless the grid is bound already before you're re-binding it to something, but you could certainly keep a flag as to whether or not you've hit the InitializeLayout event has been fired, and if not bail out of InitializeRow.
-Matt