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
604
Changing background color for a specific field
posted

Hi,

I need to mark a specific field in the XamDataGrid with a color (to mark it as a required field), so I wrote the following style:

<Style x:Key="requiredFieldCell" TargetType="{x:Type igDP:CellValuePresenter}">

<Style.Triggers>

     <DataTrigger Binding="{Binding Path=IsAddRecord,

           RelativeSource={RelativeSource AncestorType={x:Type igDP:DataRecordPresenter}}}"    

           Value="False">

           <Setter Property="Background" Value="{StaticResource requiredFieldBrush}" />

    </DataTrigger>

</Style.Triggers>

</Style>

And I assign the style to the specific field.

The only thing I wanted to change is the background of this field when it's not active and not select. I would like the color of the cell in this field to be the same as other fields when it's selected/active/hovered over, but for some reason this is not the case.

So my questions are:

1. The only thing I specified in my "requiredFieldCell" style is the background color. Why are all other colors are effected by this change too?

2. Whay else should I specify in my "requiredFieldCell" style to acheive the functionality I'm looking for?