Posted 26 October 2021, 5:47 am EST
Hello!
I have a C1DataGrid bound to a DataTable. Changes are buffered in the grid and are saved only when user presses “Save”-button.
Thats why I need is to mark new and edited rows by colouring row’s header.
I’ve managed to mark edited rows in the event handler of the “CommittedRowEdit”-event:
if (_dataTable.Rows(e.Row.Index-1).RowState == DataRowState.Modified) {
e.Row.HeaderPresenter.Background = new SolidColorBrush(...);
}
It’s a bit clumsy using internal variable holding data, but e.Row object doesn’t have its state - modified or not. And e.Row.DataItem doesn’t have it either.
But I cannot use this way for the new rows - when handling this event is row’s HeaderPresenter not yet loaded. On the other hand catching LoadedRowHeaderPresenter-event also doesn’t do, thus all the rows send it when loading and after adding a new row.
Is there perhaps another way to do this?
Regards,
firelex