wpf-devexpress-dot-xpf-dot-grid-dot-treelistview-8343e667.md
Enables you to provide custom animation played when grid data is vertically scrolled (per-pixel).
Namespace : DevExpress.Xpf.Grid
Assembly : DevExpress.Xpf.Grid.v25.2.dll
NuGet Package : DevExpress.Wpf.Grid.Core
public event CustomScrollAnimationEventHandler CustomScrollAnimation
Public Event CustomScrollAnimation As CustomScrollAnimationEventHandler
The CustomScrollAnimation event's data class is DevExpress.Xpf.Grid.CustomScrollAnimationEventArgs.
The TreeListView.AllowPerPixelScrolling option must be set to true , and the TreeListView.ScrollAnimationMode property must be set to ScrollAnimationMode.Custom.
This example shows how to implement a custom animation displayed when a user vertically scrolls the GridControl (per-pixel scrolling):
true.Custom.View Example: Implement Custom Scroll Animation
<dxg:GridControl Name="grid" AutoGenerateColumns="AddNew">
<dxg:GridControl.View>
<dxg:TableView Name="view"
AutoWidth="True"
AllowScrollAnimation="True"
ScrollAnimationMode="Custom"
CustomScrollAnimation="view_CustomScrollAnimation"/>
</dxg:GridControl.View>
</dxg:GridControl>
void view_CustomScrollAnimation(object sender, DevExpress.Xpf.Grid.CustomScrollAnimationEventArgs e) {
e.Storyboard = new Storyboard();
DoubleAnimation animation = new DoubleAnimation {
From = e.OldOffset,
To = e.NewOffset,
Duration = new Duration(TimeSpan.FromMilliseconds(600)),
EasingFunction = new ExponentialEase() { Exponent = 0 }
};
e.Storyboard.Children.Add(animation);
}
Private Sub view_CustomScrollAnimation(ByVal sender As Object, ByVal e As DevExpress.Xpf.Grid.CustomScrollAnimationEventArgs)
e.Storyboard = New Storyboard()
Dim animation As DoubleAnimation = New DoubleAnimation With {.From = e.OldOffset, .[To] = e.NewOffset, .Duration = New Duration(TimeSpan.FromMilliseconds(600)), .EasingFunction = New ExponentialEase() With {.Exponent = 0}}
e.Storyboard.Children.Add(animation)
End Sub
See Also