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

Grid Scroll

Hi,

Is there any DataBoundGrid event which fires after Scroll thumb in a grid is dragged and released. The event iam looking should not fire for any other scroll action.

Thanks,
Ravi.

3 Replies

HA haneefm Syncfusion Team November 7, 2007 09:11 PM UTC

Hi Ravi,

Maybe the VScrollBar.Scroll (or HScrollBar.Scroll) event will get you what you need. In that event, you can use e.Type property to detect the scrollbox is being moved by ThumbTrack. Below are the codes:

this.grid.VScrollBar.Scroll += new ScrollEventHandler(VScrollBar_Scroll);


void VScrollBar_Scroll(object sender, ScrollEventArgs e)
{
if (e.Type == ScrollEventType.ThumbTrack)
{
Console.WriteLine("Scrollbox is being moved by ThumbTrack");
}
}


Let me know if this helps.

Best regards,
Haneef


RA Ravi November 8, 2007 03:59 PM UTC

Hi Haneef,

Thanks for your reply, your answer is helpful to me.

How can i move the grid current cell focus to the first visible row and column after the scroll thumb is moved.

Thanks,
Ravi.


AD Administrator Syncfusion Team November 8, 2007 04:27 PM UTC

Try code such as this:

private bool thumbPositionSet = false;
void VScrollBar_Scroll(object sender, ScrollEventArgs e)
{
if (e.Type == ScrollEventType.ThumbPosition)
{
thumbPositionSet = true;
}
else if(e.Type == ScrollEventType.EndScroll && thumbPositionSet)
{
thumbPositionSet = false;
this.gridControl1.CurrentCell.MoveTo(gridControl1.TopRowIndex, gridControl1.LeftColIndex);
}
}


Loader.
Live Chat Icon For mobile
Up arrow icon