How to highlight edited cell in a datagrid -


How can I highlight a cell in DataGrid that has been edited? XAML solution is better through some styles using the trigger. But if not possible, a code behind the approach would be quite good.

I am not posting any code because I had no breaks from the problem.

Answer only to create a style to target datagridges and trigger the situation through binding It is expected that the following steps are easy to follow:

  // This indicates that you want to list the datagrid & lt; RowValues ​​& gt; RowsView {get;} // rows was the list & lt; Row value & gt; Rowlooz // and Rovyu public class rosy {public bole is co-edited {back to the edit}; Set {if (_isEdited == value) returns; _isEdited = value; RaisePropertyChanged ((= = IsEdited); }} Set the public string value {get {return_value;} {if (_value == value) return; _value = value; // Check whether the value has been edited IsEdited = _value == _originalValue; RaisePropertyChanged ((= => Price); }}} // So the code reaching into the structure will look like this: var row = RowView [0]; Var cell = line [1]; Cell.It has been edited ... just make it easy to see the XAML binding below. & Lt; DataGrid ItemsSource = "{View Binding Rows}" & gt; & Lt; DataGridTemplateColumn & gt; & Lt; DataGridTemplateColumn.CellStyle & gt; & Lt; Style TargetType = "{x: type datagridel}" & gt; & Lt; Setter property = "background" value = "transparent" /> & Lt; Style.Triggers & gt; & Lt; Datatiger binding = "{Binding RowValues ​​[0] .Essified)" value = "true" & gt; & Lt; Setter property = "background" value = "{static reassering missdatabish}" /> & Lt; / DataTrigger & gt; & Lt; /Style.Triggers> & Lt; / Style & gt; & Lt; /DataGridTemplateColumn.CellStyle> & Lt; DataGridTemplateColumn.CellTemplate & gt; & Lt; DataTemplate & gt; & Lt; Text block text = "{binding lineviews [0]. Value}" /> & Lt; / DataTemplate & gt; & Lt; /DataGridTemplateColumn.CellTemplate> & Lt; DataGridTemplateColumn.CellEditingTemplate & gt; & Lt; DataTemplate & gt; & Lt; Text box text = "{binding linewheels [0]. Value}" /> & Lt; / DataTemplate & gt; & Lt; /DataGridTemplateColumn.CellEditingTemplate>   

....

Comments