0

suppose i have a one data-grid in main window form. i would like to apply cell style like background for different column depend upon cell value condition.

is this possible? any example..

2

1 Answer 1

0

You have to use the MultiDataTrigger class.

example:

<Style TargetType="TextBox">
   <Style.Triggers>
      <MultiDataTrigger>
           <MultiDataTrigger.Conditions>
               <Condition Binding="{Binding XXXX}" Value="YYYY"/>
               <Condition Binding="{Binding WWWW}" Value="ZZZZ"/>
           </MultiDataTrigger.Conditions>
           <Setter Property="Background" Value="Red"/>
      </MultiDataTrigger>
   </Style.Triggers>
</Style>
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.