Horizontal Scrolling w/ Mouse Wheel/Trackpad

3 posts, 1 answers
  1. Lee
    Lee avatar
    5 posts
    Member since:
    Jun 2020

    Posted 08 Feb Link to this post

    Hey everyone,

    I'm looking to have a RadGridView's horizontal scroll bar react to a trackpad or mouse wheel input. Vertical scrolling works just fine, but is there a way to set it for horizontal as well? I know some apps have that functionality only when the user has the mouse hovered over the scroll bar.

    Is this possible? Did I miss a setting somewhere?

    Thanks!

  2. Answer
    Vladimir Stoyanov
    Admin
    Vladimir Stoyanov avatar
    759 posts

    Posted 11 Feb Link to this post

    Hello Lee,

    Generally speaking, the touchpad scrolling is not explicitly supported in WPF controls. The vertical scrolling works because the scrolling gesture is translated to a MouseWheel event. You can observe the same behavior with a standard Microsoft DataGrid (vertical touchpad scrolling works and horizontal touchpad scrolling does not work).

    If you want to enable horizontal touchpad scrolling, you can use the approach demonstrated in the following article: Support Horizontal Scrolling of TouchPad in WPF Application. After you detect a horizontal touchpad scroll, you can use the ChildrenOfType method in order to find the GridViewScrollViewer element inside the RadGridView and use its ScrollToHorizontalOffset method.

    I am attaching a sample project demonstrating this approach. Hope you find this helpful. 

    Regards,
    Vladimir Stoyanov
    Progress Telerik

    Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

  3. Lee
    Lee avatar
    5 posts
    Member since:
    Jun 2020

    Posted 11 Feb in reply to Vladimir Stoyanov Link to this post

    Hello Vladimir,

    Your solution worked perfectly! Thanks for taking the time to explain that, and setup a sample project. It was very helpful.

    Thanks again,

    Lee

Back to Top