Scroll to last item of SfListView

Hi,

I've tried a below code for scrolling to last item but it's not working properly.
Could you tell me what the problem for that?


listView.Loaded += ListView_Loaded;    
    
private void ListView_Loaded(object sender, ListViewLoadedEventArgs e)    
{    
    (listView.LayoutManager as LinearLayout).ScrollToRowIndex(ViewModel.contactsinfo.Count);    
}    
    


 Sample code  attached.

Thanks in advance.


Attachment: ListView_DataTemplateSelector_ea5bc339.zip

3 Replies

MK Muthu Kumaran Gnanavinayagam Syncfusion Team October 11, 2017 11:35 AM UTC

Hi Spark,   
  
We have checked with the reported query “ScrollView does not scroll to last item” from our side and referred the attached sample. In the sample, we have noticed that you have set the main page of the application as MainPage.cs in App.cs page, but you have wrongly hooked the loaded event in MainPageCs.cs. Thus the MainPageCs is not initialized and loaded event will not be triggered. We have ensured by assigning the main page as MainPageCs in your application and the ScrollToRowIndex works as expected.    
  
For your assistance we have attached the working sample link below.   
  
  
Please let us know if you require further assistance.   
  
Regard,   
G. Muthu Kumaran.   



SP spark October 12, 2017 12:52 AM UTC

Hi Muthu,

Thank you for the quick response.

Sorry, I gave you a wrong sample code.
That's not a event problem.

Please download sample code below link.
https://www.dropbox.com/s/ed67zeb5qdqz6pa/sample.zip?dl=0



Now it shows like this. (Didn't Scroll to last item)


Suppose to be like this if it works well.



MK Muthu Kumaran Gnanavinayagam Syncfusion Team October 12, 2017 12:40 PM UTC

Hi Spark, 
 
A support incident has been created under your account to track the status of the reported query. Please log on to our support website to check for further updates.     
  
 
Regards, 
G.Muthu Kumaran. 


Loader.
Up arrow icon