0

I have a style trigger that is coloring Teleriks gridview cell background a color when the cell string matches a certain text string. This code works and is shown below:

<Style TargetType="{x:Type TextBlock}">
            <Style.Triggers>
                <Trigger Property="Text" Value="Missing">
                    <Setter Property="Background" Value="LightPink"/>
                </Trigger>
            </Style.Triggers>
        </Style>

I am trying to tie that in with a toggle button in the UI so the user can turn this highlighting on/off. I have tried to use a MultiDataTrigger but I do not know the column name as the data is coming in as expando objects at runtime. Ive tried a few things, here is the latest thing Ive tried:

<Style TargetType="{x:Type TextBlock}">
            <Style.Triggers>
                <MultiDataTrigger>
                    <MultiDataTrigger.Conditions>
                        <Condition Binding="{Binding ElementName=GridViewSchedule}" Value="Missing" />
                        <Condition Binding="{Binding ElementName=ToggleWarning, Path=IsChecked}" Value="True" />
                    </MultiDataTrigger.Conditions>
                    <Setter Property="Background" Value="LightPink"/>
                </MultiDataTrigger>
            </Style.Triggers>
        </Style>

Appreciate any direction you can provide! Cheers

  • Is the toggle supposed to be by row, or global? (I.e. should the user be able to toggle the highlighting for each row with a seperate toggle button for each, or should there be only one toggle for the entire grid?) – Keith Stein Feb 24 '22 at 22:13
  • Its meant to be for the entire grid as this "missing" data may be on various cells per column and rows. Its pulling data from a 3d modelling program so Im showing the user which metadata is missing from their 3d elements. – Mano1192 Feb 25 '22 at 21:46

0 Answers0