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

Hide context cenu on scrollbar

1 Answer 50 Views
VirtualGrid
This is a migrated thread and some comments may be shown as answers.
Luis
Top achievements
Rank 1
Luis asked on 23 Jan 2018, 12:01 PM
Dear Sirs, 

I'm using a RadVirtualGrid which shows a scrollbar sometimes. My issue is that when the user rightclicks on the scrollbar it shows an undesirable contextmenu.
How do I disable this contextmenu? 

Follows an image attached showing this contextmenu.

1 Answer, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 26 Jan 2018, 09:01 AM
Hello Luis,

In order to achieve your goal, you need to set  ContextMenuService.IsEnabled property of the scrollbar to False. You can find the scrollbars by using our ChildrenOfType extension method like so:


this.Loaded += MainWindow_Loaded;
   
 
   void MainWindow_Loaded(object sender, RoutedEventArgs e)
   {
       var scrollBars = this.ChildrenOfType<ScrollBar>();
 
       foreach (var scrollBar in scrollBars)
       {
           ContextMenuService.SetIsEnabled(scrollBar, false);               
       }
   }

I hope this helps.


Regards,
Yoan
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
Tags
VirtualGrid
Asked by
Luis
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Share this question
or