This is a migrated thread and some comments may be shown as answers.

Horizontal Scrolling w/ Mouse Wheel/Trackpad

2 Answers 781 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Lee
Top achievements
Rank 1
Veteran
Lee asked on 08 Feb 2021, 05:53 PM

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 Answers, 1 is accepted

Sort by
0
Accepted
Vladimir Stoyanov
Telerik team
answered on 11 Feb 2021, 10:48 AM

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/.

0
Lee
Top achievements
Rank 1
Veteran
answered on 11 Feb 2021, 03:32 PM

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

Tags
GridView
Asked by
Lee
Top achievements
Rank 1
Veteran
Answers by
Vladimir Stoyanov
Telerik team
Lee
Top achievements
Rank 1
Veteran
Share this question
or