When I raise RaisePropertyChanged("SelectedItem"); in ViewModel, it works fine, I can see selectedItem is changed but I want to scroll to the selectedItem, Thats why I tried SelectionChanging or SelectionChanged events but not luck. they arent fired. they are fired only when I tap on an item. What is the reason for that? How can I achieve my purpose? I need to scroll to selecteditem but selecteditem should be set in the ViewModel
DBDinesh Babu Yadav Syncfusion Team June 5, 2017 08:54 AM UTC
Sorry for the inconvenience caused.
We would like to let you know that the SelectionChanging and SelectionChanged events are triggered only when the selection is performed by gesture action instead of programmatic selection. However, the reported requirement “Need to scroll to selected item in SfListView” can achieved by sample level. While initializing the SfListView, you can scroll to SelectedItem through Loaded event in which you can get the selected item’s index from the DisplayItems.Indexof() method and scroll to that item by using ScrollToRowIndex method as like below code snippet.
Also, if you are changing the SelectedItem (ViewModel property) through button click event or any gesture action at runtime, you can use the ScrollToRowIndex method in the clicked or gesture event as same like above code snippet.
For your reference, we have attached the sample and you can download it from the below link.