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.

How to animate the GridCell when underlining property gets changed in SfDataGrid?

In SfDataGrid, it is possible to animate the cell background when changing the underlining property by customizing style for GridCell and writing the behavior for the Grid inside GridCell control template.

The following code example demonstrates how to add behavior in GridCell that animates the background of the cell when underlying property get changed.

XAML

 

Note: Above code example shows only the partial ControlTemplate of GridCell for reference. You can edit the ControlTemplate of GridCell by right clicking the SfDataGrid in design view and select the Edit Additional Templates -> Edit Cell Style -> Edit a Copy.

You can set this Style to a particular column alone by setting GridColumn.ColumnStyle property of column by defining key for the style. Otherwise it is applied for all the columns.

XAML

 

You can define the ColourAnimation for animating GridCell. And you can get the GridCell in behavior by using TemplateParent in SfDataGrid. The background of Grid is animated using property changed event.

The following code example shows the AnimatedBehaviour for changing Background of GridCell when underling ViewMode property gets changed.

C#

 

The following screen shot shows the animated SfDataGrid.

F:\Farjana\F Drive\KB\Animation\WPF.png

You can refer to the following sample link for animating GridCell when underlying property gets changed in SfDataGrid.

Sample Link: AnimateCellGrid_WPF

Article ID: Published Date: Last Revised Date: Platform: Control: .NET Framework: Product Version:
3175 01/12/2015 06/09/2015 WPF SfDataGrid 4.5 12.3.0.36
Did you find this information helpful?
Comments
Daniel Koffler Aug 17, 2018

Is the same possible with Xamarin Forms? If yes, could you provide an example?

Reply
Add Comment
You must log in to leave a comment

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.