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

Radgridview storyboard issue

2 Answers 155 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Bhargava
Top achievements
Rank 1
Bhargava asked on 29 Jan 2011, 10:55 AM
Hello,

I have a requirement where I want to highlight a for x seconds when the object bound to a row is in certain state.I am using a datatrigger together with a coloranimation for this purpose. When the condition is met, I trigger the storyboard action.  Below is the xaml. The problem I am facing is when I scroll the animation seems to be carrying to other rows which do not satisfy the condition. I have enabled row virtualization. This seems something to do with recycling the row containers ? Any help is greatly appreciated.

 <Style x:Key="test" TargetType="{x:Type telerikGridView:GridViewRow}">
            <Setter Property="Background" Value="White"/>
            <Style.Triggers>
                <DataTrigger Value="true">
                    <DataTrigger.Binding>
                        <MultiBinding Mode="OneWay" Converter="{StaticResource backgroundConverter}">
                            <Binding Path="FirstName"/>
                            <Binding Path="LastName"/>
                        </MultiBinding>
                    </DataTrigger.Binding>
                    <DataTrigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <ColorAnimationUsingKeyFrames AutoReverse="True"  BeginTime="00:00:00" Duration="00:00:5"                                                               Storyboard.TargetProperty="(Control.Background).(SolidColorBrush.Color)">
                                    <LinearColorKeyFrame Value="Green" KeyTime="00:00:.5" />
                                </ColorAnimationUsingKeyFrames>
                            </Storyboard>
                        </BeginStoryboard>
                    </DataTrigger.EnterActions>
                </DataTrigger>
            </Style.Triggers>
        </Style>

2 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 31 Jan 2011, 05:19 PM
Hi Bhargava,

 
Can you please try to disable the row virtualization and let us know what happened.
In addition to this you can send us a small application which could help us to see what is going on in this case.

All the best,
Vanya Pavlova
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Bhargava
Top achievements
Rank 1
answered on 31 Jan 2011, 05:31 PM
I tried disabling virtualization, but did not help. Then I tried using the DataTrgger.ExitAction and added a RemoveStoryBoard to the ExitAction which seems to be working.The style looks as below now.


<Style x:Key="test" TargetType="{x:Type telerikGridView:GridViewRow}">
            <Setter Property="Background" Value="White"/>
            <Style.Triggers>
                <DataTrigger Value="true">
                    <DataTrigger.Binding>
                        <MultiBinding Mode="OneWay" Converter="{StaticResource backgroundConverter}">
                            <Binding Path="FirstName"/>
                            <Binding Path="LastName"/>
                        </MultiBinding>
                    </DataTrigger.Binding>
                    <DataTrigger.EnterActions>
                        <BeginStoryboard Name="ssss">
                            <Storyboard>
                                <ColorAnimationUsingKeyFrames AutoReverse="True"  BeginTime="00:00:00" Duration="00:00:5"                                                               Storyboard.TargetProperty="(Control.Background).(SolidColorBrush.Color)">
                                    <LinearColorKeyFrame Value="Green" KeyTime="00:00:.5" />
                                </ColorAnimationUsingKeyFrames>
                            </Storyboard>
                        </BeginStoryboard>
                    </DataTrigger.EnterActions>
                    <DataTrigger.ExitActions>
                         <RemoveStoryboard BeginStoryboardName="ssss" />
                    </DataTrigger.ExitActions>
                </DataTrigger>
            </Style.Triggers>
        </Style>
Tags
GridView
Asked by
Bhargava
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Bhargava
Top achievements
Rank 1
Share this question
or