The latest version of VIBlend Controls for Silverlight features significant improvements to the DataGrid’s scrolling capabilities. DataGrid now offers fast animated smooth scrolling with inertia for impressive UI performance. In this blog post, we will introduce you how to use the properties that you need to know, in order to set up the DataGrid’s scrolling behavior. The ScrollAnimationMode property allows you to enable or disable the animated scrolling. The DataGrid’s default animation mode is scrolling with intertia, In order to disable the scrolling, you need to set the ScrollAnimationMode property to ScrollAnimationMode.No_Animation.
C#
dataGrid.ScrollAnimationMode = DataGrid.ScrollAnimationModes.NO_ANIMATION;
VB .NET
dataGrid.ScrollAnimationMode = DataGrid.ScrollAnimationModes.NO_ANIMATION
Use the following code snippet to enable the smooth scrolling mode:
C#
dataGrid.ScrollAnimationMode = DataGrid.ScrollAnimationModes.SMOOTH_SCROLL;
VB .NET
dataGrid.ScrollAnimationMode = DataGrid.ScrollAnimationModes.SMOOTH_SCROLL
VIBlend DataGrid control also supports a beautiful opacity animation while you scroll its content. You can enable this animation by using the ScrollOpacityAnimationEnabled property. The code snippet below enables the scrolling opacity animation:
C#
dataGrid.ScrollOpacityAnimationEnabled = true;
VB .NET
dataGrid.ScrollOpacityAnimationEnabled = True
The ScrollAnimationTime property allows you to change the duration of the scrolling animation. Here is demonstrated how to the set the duration to 1 second:
C#
dataGrid.ScrollAnimationTime = new TimeSpan(0, 0, 1);
VB .NET
dataGrid.ScrollAnimationTime = New TimeSpan(0, 0, 1)
By default, when the user drags the thumb on a scrollbar, the content view continuously updates. In deferred scrolling, the content is updated only when the user releases the thumb. You can enable the deferred scrolling mode by using the DeferredScrollingEnabled property.
For example:
C#
dataGrid.DeferredScrollingEnabled = true;
VB .NET
dataGrid.DeferredScrollingEnabled = True