This is a migrated thread and some comments may be shown as answers.

I have to scroll to activate cell style triggers

1 Answer 116 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Erik
Top achievements
Rank 1
Erik asked on 15 Jul 2011, 02:09 PM
I have an implicit style:

<telerik:RadGridView.Resources>
    <Style TargetType="{x:Type telerik:GridViewCell}">
        <Setter Property="Foreground" Value="Red" />
        <Style.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding IsAllowedToEdit}" Value="True"/>
                    <Condition Binding="{Binding Path=Column.IsReadOnly, RelativeSource={RelativeSource Self}}" Value="False"/>
                </MultiDataTrigger.Conditions>
                <MultiDataTrigger.Setters>
                    <Setter Property="Background" Value="#DBFFEC"/>
                </MultiDataTrigger.Setters>
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>
</telerik:RadGridView.Resources>

But i have to scroll up and down, and one after another each row cells turns green if it is supposed to.

How can i fix this?

1 Answer, 1 is accepted

Sort by
0
Accepted
Vanya Pavlova
Telerik team
answered on 15 Jul 2011, 02:18 PM
Hello Erik,

 

If you want to change the appearance of GridViewCell/GridViewRow etc. based on undelrying property values you should use StyleSelectors. That is the recommended approach and you will avoid such undesired effects in your application. The same demo is valid for WPF as well. 




Kind regards,
Vanya Pavlova
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
GridView
Asked by
Erik
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Share this question
or