We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

GridControl and its Parent ScrollBar scrolls together when mouse scrolled.

Hi,

I am using GridControl in my app. GridControl will display Vertical Scroll bar after loading items.
At the the same time as items are more in UI, GridControl's parent, Form control also has its own ScrollBar.
When we scroll mouse on top of GridControl, both GridControl and Form's ScrollBar scrolls together.
If we scroll on top of ListView (Default win form control), only ListView ScrollBar scrolls. If we move mouse control outside, then Form's ScrollBar moves.
I need same behavior in GridControl. Could you pls help me to solve this issue?

Regards,
Harinarayana.

3 Replies

AA Arulraj A Syncfusion Team February 14, 2019 05:40 AM UTC

Hi Harinarayana, 

Thanks for using Syncfusion product. 

You can avoid scrolling of GridControl’s parent by overriding its parent’s OnMouseWheel method and allow mouse wheel if its child element is empty at the mouse over point. Here we have restricted for Form’s mouse wheeling while scrolling is done in GridControl. 

protected override void OnMouseWheel(MouseEventArgs e) 
{ 
    var child = this.GetChildAtPoint(e.Location); 
    if (child == null) 
        base.OnMouseWheel(e); 
} 


Regards,  
Arulraj A  



HA Harinarayana February 14, 2019 09:47 AM UTC

Thank you very much for the quick helpful response and support.
Now it is working fine with the below solutions.


AA Arulraj A Syncfusion Team February 14, 2019 10:10 AM UTC

Hi Harinarayana, 

Thanks for the update. 

Please feel free to contact us in case of any further difficulty. We'll be glad to assist you. 

Regards, 
Arulraj A 


Loader.
Live Chat Icon For mobile
Up arrow icon