Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
300
How to disable scrolling on UltraGrid if context menu is open
posted

1. In windows file browser, internet explorer etc., if you open a context menu - the wheel scrolling is not possible.

2. And by right click on unselected row it will be first selected, and other selection is cancelled.

I have a task to implement this behaviour in our software on the UltraGrid. Is it possible and if - how?

Best Regards,

Andy

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi Andy,

    vilinski said:
    1. In windows file browser, internet explorer etc., if you open a context menu - the wheel scrolling is not possible.

    I tried this out with Internet Explorer and it works as you describe. While a menu is dropped down, the mouse wheel will not scroll the page. But this does not seem to be universal. I can scroll when using MS Outlook 2007, for example. It also work with Firefox.

    Anyway, there's nothing built-in to DotNet or the grid to handle this as far as I know. You could set a flag when you dropdown a menu and the clear that flag when the menu closes. And then you could handle the MouseWheel event of the grid and cancel the event when the flag is true.

    vilinski said:
    2. And by right click on unselected row it will be first selected, and other selection is cancelled.

    This is easy enough to do in code using the MouseDown event of the grid. You just set the Selected property on the row to true. The only slightly tricky part of this is determining which row was clicked on in MouseDown. Here's a KB article that shows you how to do it. 

    HOWTO:UltraWinGrid Mouse Position and Row Identification

Children
No Data