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

programatically scrolling grid.

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

Thanks

Dinesh

3 Replies

AD Administrator Syncfusion Team 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


DU dinesh upreti 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


AD Administrator Syncfusion Team 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

Loader.
Live Chat Icon For mobile
Up arrow icon