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.

programatically scrolling grid.

Thread ID:

Created:

Updated:

Platform:

Replies:

58132 Mar 19,2007 02:39 PM Mar 20,2007 02:43 PM Windows Forms 3
loading
Tags: GridControl
dinesh upreti
Asked On March 19, 2007 02:39 PM

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 03:00 PM

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 08:54 AM

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 02:43 PM

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.

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.

;