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

How does ScrollToRowIndex works if there is grouping?

when there is grouping like below
  - group 1
     -item 1 
     - item 2
 - group 1
      item 3
  - group 3
      item 4
      item 5 
      item 6

if i want to scroll to item 5 using ScrollToRowIndex method which index number should be used?
1) is parameter index for this method start from 0 or 1.
2) ScrollToRowIndex(index) - index parameter includes group items or not? so if it includes, it should be 8 (if starting index 1) 7 ( if starting index 7)

can you please clarify all these confusions? please also extend your documentation, it is not very clear. 
thanks,

Emil


1 Reply

DB Dinesh Babu Yadav Syncfusion Team September 13, 2017 11:36 AM UTC

Hi Emil 
 
Sorry for the inconvenience. 
 
Query 
Response 
Is parameter index for this method start from 0 or 1. 
Parameter index for ScrollToRowIndex method starts from 0. 
ScrollToRowIndex(index) - index parameter includes group items or not?  
When grouping feature is used in list view, group header item index is also included in index parameter. However, you can get the desired item index by passing the underlying data in DisplayItems.IndexOf method as like below code example. 
 
Code Example[C#]: 
int itemindex = listView.DataSource.DisplayItems.IndexOf(listView.SelectedItem); 
(listView.LayoutManager as LinearLayout).ScrollToRowIndex(itemindex); 
 
We will update the same in our documentation too within 2017 Volume 4 main release. 
 
Please let us know if you require further assistance. 
 
Regards, 
Dinesh Babu Yadav 
 


Loader.
Live Chat Icon For mobile
Up arrow icon