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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

MoveDown event on scroll bar

Thread ID:

Created:

Updated:

Platform:

Replies:

124110 May 17,2016 08:30 PM UTC May 19,2016 10:37 AM UTC WinForms 3
loading
Tags: GridControl
Shaolin Xiong
Asked On May 17, 2016 08:30 PM UTC

Hi,

I am trying to attach an event handler to GridControl to catch a mouse down event on a scroll bar of the GridControl. I have tried MouseDown, GridControlMouseDown and ScrollControlMouseDown with no success. Could someone suggest a solution please?

Thanks!
Shaolin

Anish George [Syncfusion]
Replied On May 18, 2016 06:46 AM UTC

Hi Shaolin, 

Thank you for using Syncfusion products. 

We request you to make use of the VerticalScroll and HorizontalScroll events for achieving this. Please refer the below code snippet. These events will be fired when the Scrollbar is clicked or moved. 

C#: 

this.gridControl1.VerticalScroll += gridControl1_VerticalScroll; 
void gridControl1_HorizontalScroll(object sender, ScrollEventArgs e) 
{ 
    // Required Code 
} 
 
this.gridControl1.HorizontalScroll += gridControl1_HorizontalScroll; 
void gridControl1_VerticalScroll(object sender, ScrollEventArgs e) 
{ 
    //Required Code 
} 

Please let us know if you need any further assistance. 

Regards,
Anish. 


Shaolin Xiong
Replied On May 18, 2016 12:42 PM UTC

Hi Anish,

I am looking for MouseDown and MouseUp events on a scroll bar. I am sorry I mistakenly used a wrong word MoveDown for the subject and it should have been MouseDown.

Thanks,
Shaolin

Anish George [Syncfusion]
Replied On May 19, 2016 10:37 AM UTC

Hi Shaolin,  

Thank you for your update. 

We regret to let you know that there is no separate event like MouseDown or MouseUp for scroll bars in GridControl. You can make use of the scroll events like HorizontalScroll, VerticalScroll, WindowScrolling, HScrollBar.Scroll, VScrollBar.Scroll etc and achieve your needs. But however you can make use of the custom scrollbar to achieve your requirement.  

You can make use of the ScrollerFrame control and assign this control to our GridControl scrollbar by using the AttachedTo property. Please refer the below code snippet. This custom scroll bar has the required MouseDown and MouseUp events. 

C#: 
ScrollersFrame scrollersFrame1 = new ScrollersFrame(); 
scrollersFrame1.AttachedTo = this.gridControl1; 
 
scrollersFrame1.HorizontalScroller.MouseDown += new MouseEventHandler(HorizontalScroller_MouseDown); 
scrollersFrame1.HorizontalScroller.MouseUp += new MouseEventHandler(HorizontalScroller_MouseUp); 
 
void HorizontalScroller_MouseUp(object sender, MouseEventArgs e) 
{ 
    // Required Code 
} 
 
void HorizontalScroller_MouseDown(object sender, MouseEventArgs e) 
{ 
    // Required Code 
} 


We have created a simple sample for your convenience. You can download it from here CustomScrollBar

Please let me know if you have any further concerns 

Regards, 
Anish. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;