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
785
XamDataGrid / Mouse Wheel Interaction
posted

Hello All,

I have placed a XamDataGrid on a System.Windows.Controls.UserControl. I would like to handle the MouseWheel event. I try to catch it at the UserControl level, but my handler never gets called. I've also tried to catch it at the XamDataGrid level, but my handler also does not get called in this case. I have noticed that if I add enough records to my XamDataGrid, it will show a scroll bar. This scroll bar can be moved with the mouse wheel. So, I suspect something within the XamDataGrid catches the MouseWheel routed event and prevents it from bubbling up to the UserControl level where I'm trying to catch it. Can anybody state whether or not this is true? And if it is true, how can I disable it so that the event can bubble up to the UserControl where I can handle it?

Thanks,

Dave

 

  • 69686
    posted

    Hello Dave,

    You can try to handle the event before the XamDataGrid handles it. You would have to handle the PreviewMouseWheel instead of the MouseWheel.