TableView.AllowPerPixelScrolling Property

Gets or sets whether per-pixel scrolling is enabled. This is a dependency property.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v20.1.dll

Declaration

public bool AllowPerPixelScrolling { get; set; }
Public Property AllowPerPixelScrolling As Boolean

Property Value

Type Description
Boolean

true to enable per-pixel scrolling; false to enable row by row scrolling.

Remarks

To learn more, see Per-Pixel Scrolling.

NOTE

If per-pixel scrolling is enabled and data rows are of different height, the last (bottom) visible row may not be displayed entirely.

Examples

This example shows how to handle the CustomScrollAnimation event to implement custom animation played when grid data is vertically scrolled (per-pixel scrolling). Note the view's AllowPerPixelScrolling and AllowScrollAnimation options must be enabled.

Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Data
Imports System.Windows.Documents
Imports System.Windows.Input
Imports System.Windows.Media
Imports System.Windows.Media.Imaging
Imports System.Windows.Navigation
Imports System.Windows.Shapes
Imports System.Windows.Media.Animation

Namespace DXGrid_CustomScrollAnimation
    ''' <summary>
    ''' Interaction logic for MainWindow.xaml
    ''' </summary>
    Partial Public Class MainWindow
        Inherits Window

        Public Sub New()
            InitializeComponent()
            grid.ItemsSource = GetData()
        End Sub

        Private Sub tableView1_CustomScrollAnimation(ByVal sender As Object, ByVal e As DevExpress.Xpf.Grid.CustomScrollAnimationEventArgs)
            e.Storyboard = New Storyboard()
            Dim animation As New DoubleAnimation()
            animation.From = e.OldOffset
            animation.To = e.NewOffset
            animation.Duration = New Duration(TimeSpan.FromMilliseconds(600))
            animation.EasingFunction = New ExponentialEase() With {.Exponent = 0}
            e.Storyboard.Children.Add(animation)
        End Sub

        Private Function GetData() As List(Of TestDataObject)
            Dim _list As New List(Of TestDataObject)()
            For i As Integer = 0 To 99
                _list.Add(New TestDataObject() With {.ID = i, .Value = String.Format("Value {0}", i)})
            Next i
            Return _list
        End Function
    End Class

    Public Class TestDataObject
        Public Property ID() As Integer
        Public Property Value() As String
    End Class
End Namespace

Implements

DevExpress.Xpf.Grid.ITableView.AllowPerPixelScrolling
See Also