Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
145
DataTrigger on Xamgrid to show Edited Rows
posted

Hi guys,

In my application I have a XamGrid that is bound to a ObservableCollection of objects. Each object has a boolean property called HasChanged which gets set to "True" anytime any of the properties in the object has changed. Im trying to show the users the rows that have been edited in a different color so they are aware and they can save the changes.

Currently this functionality is partially working. When I make changes to a property on an object, the row doesnt change color, but when I sort any of the columns the grid gets refreshed or repainted and the row changes to red. This is the code the I have for the DataTrigger:

<ig:XamGrid.Resources>

<Style TargetType="{x:Type ig:CellControl}">

<Style.Triggers>

<DataTrigger Binding="{Binding HasChanged, UpdateSourceTrigger=PropertyChanged}" Value="True">

<Setter Property="Foreground" Value="Red"/>

</DataTrigger>

</Style.Triggers>

</Style>

</ig:XamGrid.Resources>

 

Any help is appreciated.

Thank you