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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

programatically scrolling grid.

Thread ID:

Created:

Updated:

Platform:

Replies:

58132 Mar 19,2007 06:39 PM UTC Mar 20,2007 06:43 PM UTC WinForms 3
loading
Tags: GridControl
dinesh upreti
Asked On March 19, 2007 06:39 PM UTC

hi,
Can you share some piece of code to programatically scroll a grid to last record. (say on click of a button)

Thanks

Dinesh

Administrator [Syncfusion]
Replied On March 19, 2007 07:00 PM UTC

Hi Dinesh,

You can get the position of vertical scroll bar using the GetCurrentVScrollPixelPos() method and set the position of vertical scroll bar using the SetCurrentVScrollPixelPos() method. Using these methods you can able to move the ScrollBar as required. Please refer to the attached sample for implementation.

If you want to scroll the specified range/cell into the view, you can use ScrollCellInView method.
this.Grid.ScrollCellInView(GridRangeInfo.Row(this.Grid.Model.RowCount -1 )); //Last row..

Best Regards,
Haneef

dinesh upreti
Replied On March 20, 2007 12:54 PM UTC

hi,
If you could translate it for use in grid grouping control, it would be great. Putting again, on the click of a button, i want the grid to be scrolled to last record. I am using grid grouping control.

Thanks in advance

>Hi Dinesh,

You can get the position of vertical scroll bar using the GetCurrentVScrollPixelPos() method and set the position of vertical scroll bar using the SetCurrentVScrollPixelPos() method. Using these methods you can able to move the ScrollBar as required. Please refer to the attached sample for implementation.

If you want to scroll the specified range/cell into the view, you can use ScrollCellInView method.
this.Grid.ScrollCellInView(GridRangeInfo.Row(this.Grid.Model.RowCount -1 )); //Last row..

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On March 20, 2007 06:43 PM UTC

Hi Dinesh,

You can try the below code snippet in button's click event.

int iMaxPixelHeight = this.gridGroupingControl1.TableControl.GetVScrollPixelHeight();
this.gridGroupingControl1.TableControl.SetCurrentVScrollPixelPos(iMaxPixelHeight);

Best regards,
Haneef

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

;