I need to display rows differently based on the RowState property of the underlaying DataRow. For example I want to display modified rows with different font style (bold). How can this be done using WinGrid?
(This is very easy using Microsoft.NET DataGridView CellFormatting event.)
stiki2008 said:True, but then the grid format only reflects the RowState by the time the row was initialized.
The row will get re-initialized any time the data source sends a notification to the grid that something has changed. So if the data changes, the event will fire again. So unless there is some state change that you are making to the row that the grid is not getting a notification for, you should be able to use InitializeRow for this.
True, but then the grid format only reflects the RowState by the time the row was initialized.
I solved this using the RowChanged event on the underlying DataTable. In the event hadler I just find a reference to the UltraGridRow and update its appearance according to the RowState.
But I still miss the CellFormatting event from the Windows.Forms DataGridView. Using this event gives you maximum flexibility in formatting the grid.
You could do this using the InitializeRow event. Use e.Row.ListObject to get the underlying data row from the data source.