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
240
How to toggle cell's backgournd and cell's value when cell is selected?
posted

Hello.

I want to toggle value of cell and background of control. when cell is selected. so i trid style of cellvaluepresenter and i can toggle background of cells. but i can not change value of cells

my code is allowed

<Style x:Key="groupdatastyle" TargetType="{x:Type igDP:CellValuePresenter}">
                <Style.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsSelected}" Value="True"/>
                            <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=Value}" Value="True"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Value" Value="False"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
                                    <StackPanel>
                                        <TextBlock Background="Gray"/>
                                    </StackPanel>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </MultiDataTrigger>
                   
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsSelected}" Value="True"/>
                            <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=Value}" Value="False"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Value" Value="True"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
                                    <StackPanel>
                                        <TextBlock Background="Blue"/>
                                    </StackPanel>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </MultiDataTrigger>
                   
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsSelected}" Value="False"/>
                            <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=Value}" Value="True"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
                                    <StackPanel>
                                        <TextBlock Background="Blue"/>
                                    </StackPanel>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </MultiDataTrigger>
                   
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsSelected}" Value="False"/>
                            <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=Value}" Value="False"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
                                    <StackPanel>
                                        <TextBlock Background="Gray"/>
                                    </StackPanel>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

...............................

<igDP:UnboundField Label="0" BindingPath="Data.[0]" DataType="{x:Type sys:Boolean}" BindingMode="TwoWay">
                            <igDP:UnboundField.Settings>
                                <igDP:FieldSettings CellValuePresenterStyle="{StaticResource groupdatastyle}"/>
                            </igDP:UnboundField.Settings>
                        </igDP:UnboundField>