We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Animation firing when grid scrolls

Thread ID:

Created:

Updated:

Platform:

Replies:

117042 Jul 28,2014 11:16 AM UTC Aug 8,2014 01:31 PM UTC WinRT 1
loading
Tags: SfDataGrid
Robert Marsh
Asked On July 28, 2014 11:16 AM UTC

I've got an SFDatagrid that runs an animation when cell contents are changed using a style:

        <Style x:Key="currRunDataCellStyle"  TargetType="TextBlock">
            <Setter Property="Background" Value="#FFC5D9F1" />
            <Style.Triggers>
                <EventTrigger RoutedEvent="Binding.TargetUpdated">
                    <EventTrigger.Actions>
                        <BeginStoryboard>
                            <Storyboard>
                                <!--Change the cell colour (of the one being updated) from Red to Normal-->
                                <ColorAnimation Duration="0:0:2" Storyboard.TargetProperty="Background.Color" From="Red" To="#FFC5D9F1" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger.Actions>
                </EventTrigger>
            </Style.Triggers>
        </Style>

The only problem is that the animation fires when I scroll the grid as well. The data hasn't changed, but the animation still kicks off. Is there anyway to stop the grid from doing this?

Cheers,

Rob

Deepak Raj Sundar [Syncfusion]
Replied On August 8, 2014 01:31 PM UTC

Hai Rob,
The  reported problem of animation firing while scrolling the grid occurs because, in the grid  we are reusing the Gridcell and the datacontext will change for cells each time we scroll. so its like updating the cell vale  . You can achieve the animation while changing cell value alone and not while scrolling by writing behavior for the grid. Please refer the sample program attached.

Attachment: CellAnimation_Collection_behavior_944d24f0.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;