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

Scroll to last item or specific item

Thread ID:





128696 Feb 6,2017 05:07 PM UTC Feb 26,2017 06:44 PM UTC Xamarin.Forms 6
Tags: SfDataGrid
Asked On February 6, 2017 05:07 PM UTC

is it possible to scroll to last item in sfdatagrid? for example, i have list of items and I add a new item with a button click, how can I scroll to this item which is last one? Is there something like ScrollTo function Xamarin Forms listview has?

Divakar Subramaniam [Syncfusion]
Replied On February 7, 2017 04:09 AM UTC

Hi Emil, 
Thanks for contacting Syncfusion Support. 
In SfDataGrid, it is possible to scroll to specific index using SfDataGrid.ScrollToRowColumnIndex() method by passing RowIndex and ColumnIndex as parameters. 
Please refer the below UG link to know more about programmatic scrolling. 

Dan Meier
Replied On February 23, 2017 04:52 AM UTC

What is the actual scrolling behavior?  When I use ScrollToRowIndex(RowIndex), I'd expect the grid to scroll so that the index row is at the top of the grid.  Similarly, with ScrollToColumnIndex(ColIndex), I'd expect the grid to scroll so that the index column is at the left of the grid.  However, neither of these behaviors happens consistently. The index row or column always seems to be in view, but not where I expect it.  It seems the scrolling behavior is non-deterministic.  What's really happening?

Replied On February 26, 2017 03:34 AM UTC

Hi Dan,

these functions only work if SfDataGrid is already created in another words if Items are already bound. Therefore you can create it in the constructor and if you want to scroll to specific column/row, you can use  OnAppearing event. I hope that it helps you. 



Replied On February 26, 2017 03:36 AM UTC

Hi Divakar,

I am mostly using mvvm and i would like to know if somehow I can achieve this in my viewmodel. I already achieved in xaml.cs as I wrote to my response to Dan. please let me know



Ashok N [Syncfusion]
Replied On February 26, 2017 12:50 PM UTC

Hi Dan, 
We have checked your query and SfDataGrid to scroll based on the given RowIndex and View size. The given RowIndex to place the top of the view when the remaining records count more than the view size. Otherwise the given RowIndex comes to the View and that RowIndex was placed based on the View size because SfDataGrid always fit the View size. This is the same for ScrollToColumnIndex also.  
Please let us know if you require further assistance on this.  

Ashok N [Syncfusion]
Replied On February 26, 2017 06:44 PM UTC

Hi Emil, 
You can use the ScrollToRowColumnInde method in your ViewModel class by using Button click in MVVM by adding command and command parameter to the button. Please refer the below KB link for Button.Command binding  


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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