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
260
BackgroundSelected and DataTrigger
posted

On the below style, I have the background set to Yellow, if there converter on the datatrigger passes true, the background is blue.

That all works fine.  However, I set the BackgroundSelected to Green, and that also works fine, except for the cells which the converter is passing true, in which case it is stuck on blue when selected.  How would I be able to set the backgroundselected to green when the datatrigger passes true?

                <Style x:Key="SampleStyle" TargetType="{x:Type igWPF:CellValuePresenter}" >

                    <Setter Property="Background" Value="Yellow"/>

                    <Setter Property="BackgroundSelected" Value="Green"/>

                    <Style.Triggers>

                        <DataTrigger Binding="{Binding Path=Record.DataItem.CHN, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type igWPF:DataRecordCellArea}}, Converter={StaticResource SampleStyleConverter}}" Value="True">

                            <Setter Property="Background" Value="Blue"/>

                            <Setter Property="BackgroundSelected" Value="Green"/>

                        </DataTrigger>

                    </Style.Triggers>

                </Style>

Parents Reply Children
No Data