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

ScrollToRowIndex doesnt work after 5 or 6th Row Index


when I use   it like below

 (list.LayoutManager as Syncfusion.ListView.XForms.LinearLayout).ScrollToRowIndex(6)

everything works fine for first 5 rows, it scrolls nicely but after 5th or 6th row it doesnt scroll properly. I tried with my implemantion I though that it is the problem with my layout but when I try your samples in your documentation, i see that it is general problem. I need this to be working for horizontal listvewi but I believe you can reproduce the problem using vertical listview as well.

<sfListView:SfListView x:Name="list"   ItemsSource="{Binding Items}" SelectionMode="Single"  SelectionGesture="Tap"
             ItemSpacing="2" AllowSwiping="False"   SelectionChanging="list_SelectionChanging"  SelectionBackgroundColor="Yellow"  Orientation="Horizontal"
                               SelectedItem="{Binding SelectedItem, Mode=OneWay}" >

1 Reply

DB Dinesh Babu Yadav Syncfusion Team June 5, 2017 08:56 AM UTC

Hi Emil, 
 
Sorry for the inconvenience caused. 
 
We have checked the reported issue “SfListView’s ScrollToRowIndex is not working” at our end and we suspect that you may have used the ScrollToRowIndex method while initializing the SfListView. We would like to let you know that while initializing the SfListView no items are generated initially so, if you have used the ScrollToRowIndex method, the scroll view won’t scroll. However, you can achieve your requirement ScrollToRowIndex while initializing the SfListView by Loaded event as like below code snippet. 
 
Code Example[C#]: 
private void ListView_Loaded(object sender, Syncfusion.ListView.XForms.ListViewLoadedEventArgs e) 
{ 
  (listView.LayoutManager as LinearLayout). 
  ScrollToRowIndex(listView.DataSource.DisplayItems.IndexOf(listView.SelectedItem));        
} 
 
For your reference, we have attached the sample and you can download it from the below link. 
 
 
Also, we have ensured by changing the ScrollToRowIndex method at runtime in a button click event and it is working fine as expected.  
 
Could you please check with the above sample?. If issue still persists at your end, please modify the sample to reproduce the issue and update us with replication procedure or video link. So, that we could able to analyze the issue better and update you with appropriate solution. 
 
Please let us know if you require further assistance. 
 
Regards, 
Dinesh Babu Yadav 
 


Loader.
Up arrow icon