Is there a way to highlight changed rows in the datagrid? Ie by binding the foreground brush (using a converter) to the state of the underlying DataRow?
Thanks
EditModeEndingEventArgs also has a Cell property. With the Cell, you can get information about the row such as the row index:
e.Cell.DataPresenter.ActiveRecord.Index
e.Editor will just be the single cell, won't it?
I wanted to highlight the whole row - I was adding the primary key in the RecordUpdated event, ie when the edit gets posted back to the underlying datasource.
Hi Steve,
Have you considered handling the EditModeEnding event in the xamDataGrid? The EditModeEndingEventArgs parameter for this event contains the Editor which loses EditMode focus when the user finishes editing the element and will allow you to AcceptChanges or reject them. With access to the editor I can do things like change the BorderBrush for the editor.
This may prove to be one possible approach.
Using a CellValuePresenter style, and a converter to go from DataRecord to Brush seems the best way..
But how to we invalidate / repaint the row (to force the cellvaluepresenter to reevaluate the brush)?
I also have the same problem and can't seem to find anything in the docs to describe how to do this. I've added an event handler for the RecordUpdated event on the xamDataGrid. In the event handler, I'm successfully able to set the value of other columns in the updated row, but I would suspect some way to also set the row color, font, etc. This seems like a "no-brainer", but still no luck after several hours research.