windows datagrid scrooling

how can i cath windows datagrid's horizontal or vertical scrooling events?

1 Reply

CB Clay Burch Syncfusion Team September 17, 2002 10:21 PM UTC

You can catch the DataGrid.Scroll event and then use GetChildAtPoint to identify which scrolbar it is.
private void dataGrid1_Scroll(object sender, System.EventArgs e)
{
	object o = this.dataGrid1.GetChildAtPoint(this.dataGrid1.PointToClient(Control.MousePosition));
	VScrollBar vScroll = o  as VScrollBar;
	if(vScroll != null)
		Console.WriteLine("VScroll");
	else
		Console.WriteLine("HScroll");
}

Loader.
Up arrow icon