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
close icon

GridControl Scrolling from Button

Hi,

Is there a way to control the scroll of the grid left and right with a button using the MVVM pattern? I have button on the view that commands to the view model, how can this issue a scroll left right to the GridControl?

Thanks
Chris


1 Reply

JJ Jawahar Jeevanandan J Syncfusion Team November 11, 2011 04:17 AM UTC

Hi Christopher,

Thank you for your patience.

You can achieve your requirement by using the below code snippet,

Code snippet[C#]

private BaseCommand _moveLeft;

public BaseCommand MoveLeft
{
get
{
_moveLeft = new BaseCommand(DoMoveLeft);
return _moveLeft;
}
}

private void DoMoveLeft(object param)
{
GridControl gc = param as GridControl;

RowColumnIndex rc_l = new RowColumnIndex();
rc_l.RowIndex = 1;
rc_l.ColumnIndex = 1;
gc.ScrollInView(rc_l);
}

Code Snippet[XAML]



For your convenience, We have also attached the sample and please find the sample in the below location,

Sample: http://www.syncfusion.com/downloads/Support/DirectTrac/86766/WPFGCScrolling-1635717338.zip

Please follow incident 86766 for further follow up on this query

Thanks,
Jawahar.




Loader.
Live Chat Icon For mobile
Up arrow icon