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

Mouse wheel scrolling in GroupView

Hi, there. I''d like to be able to provide scrolling support in a GroupView control using the mouse wheel. So far, I haven''t found a way to do it. Is this possible? If so, could someone provide me with an example on how I could implement it? Thanks for the help.

5 Replies

EP Ebenezer P Syncfusion Team November 23, 2005 09:33 AM UTC

Hi Rick, I am afraid, GroupView does not support the mouse wheel scrolling. However, you can implement it quite easily. By extending GroupView, you can make the DoScroll method public. Then handle MouseWheel event and scroll the GroupView yourself by calling DoScroll. I have attached a sample that completely demonstrates this. Please note that in the sample the mouse wheel will only cause the GroupView to scroll while it has focus. Let me know if you have any questions. Thanks for using Syncfusion products. Regards, Mano GroupView_MouseWheelScroll.zip


RE Rick Elliott January 27, 2006 09:43 PM UTC

Hi, there. I''ve just gotten around to implementing this solution, so I''m sorry for the delay. This solution works fine for scrolling the group view. However, I''ve got a few questions that I was hoping you could help me with: 1. Is there a way to figure out that the group view is at the last item and make it stop? In other words, I''d like to stop scrolling the list of items when the last item shows up at the bottom of the control instead of scrolling all the way to the top and disappearing. 2. Is there a way for me to change the behavior of the up/down scroll buttons to make them display more than one item at a time? 3. Do you have any suggestions for how I could get the group view to scroll with the mouse wheel without the group view control having focus? I''d like to be able to use the mouse wheel when the mouse is just over the control without clicking on it first. That''s it for now. Any help would be greatly appreciated. Thanks.


MJ Mano J Syncfusion Team January 31, 2006 03:00 PM UTC

Hi Rick, I apologize for the delay. I am afraid, it is not possible to achieve these features (1 and 2). I will make this as a feature request # 722 in this regard Feature Request # 722 - Add mouse wheel scrolling support for GroupView For feature # 3: You could set the focus to the groupView in MouseEnter event private void grpvwscroll_MouseEnter(object sender, System.EventArgs e) { this.grpvwscroll.Focus(); } If I come up with any workaround, I will let you know. We will try to implement this feature at the earliest. Thank you for your patience. Let me know if you have any questions. Regards, Mano


RE Rick Elliott February 1, 2006 09:42 PM UTC

Hi, Mano. After some further research, I was able to master issue #1. It appears that the protected CalculateItemsPerPage method will return the number of items currently displayed on the page. This gives me enough information to determine when to stop scrolling with one catch: it scrolls one line to far. It''s good enough for the moment, though I''d like to see it as an enhancement. It looks like the control already knows where the bottom of the scroll region is (the down scroll button disappears when the last item appears); there''s just no way to get to that information to help. For anyone else with the same issue, I subscribed to two events in the control''s constructor: MouseWheel and Resize. Resize resets a module level variable that stores the number of items that can be displayed. MouseWheel handles scrolling the group view if the number of items displayed >= max items display. Here''s the code for my hooks: protected void GroupViewMouseScroll_MouseWheel(object sender, MouseEventArgs e) { // See if we want to scroll up in the group view if (e.Delta >= 120) // Scroll the group view upwards DoScroll(false,false); // See if we want to scroll down in the group view. The list stops scrolling when the number of items // on the group view < maximum that can be displayed. if ((e.Delta <= -120) && (this.CalculateItemsPerPage() >= mintMaxItems)) // Scroll the group view downwards DoScroll(true,false); } // End GroupViewMouseScroll_MouseWheel method private void GroupViewMouseScroll_Resize(object sender, EventArgs e) { // Get the maximum number of items that can be displayed mintMaxItems=this.CalculateItemsPerPage(); } // End GroupViewMouseScroll_Resize method Just thought I''d throw out my workaround for anyone else who might need it. Thanks.


MJ Mano J Syncfusion Team February 2, 2006 04:33 AM UTC

Hi Rick, Thank you for sharing this workaround. We appreciate your interest in Syncfusion products. Regards, Mano

Loader.
Live Chat Icon For mobile
Up arrow icon