I want to set custom foreground and background when editing a cell. Right now have a value that sets the background and foreground through a value converter to different values depending on the value of a specific field. In particular I have a special color combination for when the default value is being used. Unfortunately the colors are not easy to see when changing this value, and do not update to the non-default valued until the cell value is changed.
Hello,
I am just checking if you require any further assistance on the matter.
Thank you for your post. The easiest way to change the background and foreground of the cell when it is in edit mode is to define styles for its editor like e.g. :
<Style TargetType="Editors:XamTextEditor">
<Style.Triggers>
<Trigger Property="IsInEditMode" Value="True">
<Setter Property="Background" Value="Yellow"/>
<Setter Property="Foreground" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="Editors:XamCurrencyEditor">
<Setter Property="Background" Value="Green"/>
<Setter Property="Foreground" Value="Blue"/>
<Style TargetType="Editors:XamNumericEditor">
<Setter Property="Background" Value="Black"/>
<Setter Property="Foreground" Value="White"/>
For more information regarding editors in the XamDataGrid, you can look into the following link :
http://help.infragistics.com/NetAdvantage/WPF/2012.2/CLR4.0/?page=xamData_Default_Editor_Types_for_Different_Data_Types.html
If you need any further assistance on this matter, feel free to ask.