Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

datagrid scroll events

37 views
Skip to first unread message

Jesse Aufiero

unread,
Sep 29, 2005, 1:09:57 PM9/29/05
to
Hello,

I need a way to detect when a user mouses up and down on a datagrid's
vertical scrollbar. However, the 'mouse down' and 'mouse up' events of the
datagrid do not fire when the scrollbar is clicked, and there are no
built-in 'scroll' events at all.

So how can this be accomplished?

Thanks!


Arun

unread,
Oct 2, 2005, 11:19:06 PM10/2/05
to
Try this code

foreach ( Control c in dataGrid1.Controls )
{
Type t = c.GetType();
if ( typeof( System.Windows.Forms.HScrollBar ).IsAssignableFrom( t
) ||
typeof( System.Windows.Forms.VScrollBar ).IsAssignableFrom( t ) )
{
ScrollBar csb = (ScrollBar)c;
csb.ValueChanged +=new EventHandler(csb_ValueChanged);
}
}

Hope this helps,

Cheers,
Arun.

Jesse Aufiero

unread,
Oct 16, 2005, 11:26:12 PM10/16/05
to
Perfecto. Thanks!

"Arun" <arunkuma...@gmail.com> wrote in message
news:1128309546.7...@g49g2000cwa.googlegroups.com...

0 new messages