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.
Unfortunately, activation email could not send to your email. Please try again.

Grid Scroll

Thread ID:

Created:

Updated:

Platform:

Replies:

69681 Nov 7,2007 03:33 PM Nov 8,2007 11:27 AM Windows Forms 3
loading
Tags: GridControl
Ravi
Asked On November 7, 2007 03:33 PM

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.

haneefm [Syncfusion]
Replied On November 7, 2007 04:11 PM

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

Ravi
Replied On November 8, 2007 10:59 AM

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.

Administrator [Syncfusion]
Replied On November 8, 2007 11:27 AM

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);
}
}


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.

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.

;