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

Disable scrolling of a RadGridView

2 Answers 148 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ludovic
Top achievements
Rank 1
Ludovic asked on 09 Nov 2015, 10:28 AM

Hi guys,

 

When I use Ctrl + mouse wheel, my Grid simulates a zoom (each height cell is modified) like this :

http://image.noelshack.com/fichiers/2015/46/1447064323-3143-noelpush.png

I use the event PreviewMouseWheel but when I "zoom/zoom out", i scroll too. So I would like to disable temporary the scrolling when Ctrl is pressed.

 

I found 

this.RadGridView.IsHitTestVisible = false;

But the Ctrl event doesn't work anymore. And Ctrl + mouse wheel is a shortcut very convenient, I would keep it... 

I found too the CanVerticallyScroll property (GridView) but the RadGridView doesn't have it (?)

 

Thanks for your help!

 

Regards.

 

I would like to disable temporary the scrolling of my RadGridView.
I would like to disable temporary the scrolling of my RadGridView.
I would like to disable temporary the scrolling of my RadGridView.
I would like to disable temporary the scrolling of my RadGridView.
I would like to disable temporary the scrolling of my RadGridView.
I would like to disable temporary the scrolling of my RadGridView.
I would like to disable temporary the scrolling of my RadGridView.

2 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 11 Nov 2015, 11:25 AM
Hi,

You can try to handle the PreviewMouseWheel when the Ctrl key is pressed. Please check the following code snippet for a reference:
private void clubsGrid_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
        {
            if (KeyboardModifiers.IsControlDown)
            {
                e.Handled = true;
            }      
        }

It works as you expected at my side. Let me know how it works for you.

Regards,
Yoan
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Ludovic
Top achievements
Rank 1
answered on 12 Nov 2015, 10:45 AM

Hi,

 

Yes, I found this solution later but my topic was considered like spam and had to be validated, so I could not post.

But your code is working. Many thanks !

  

Regards.​

Tags
GridView
Asked by
Ludovic
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Ludovic
Top achievements
Rank 1
Share this question
or