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.
Unfortunately, activation email could not send to your email. Please try again.

SfListView Doesnt refresh Items using MVVM

Thread ID:

Created:

Updated:

Platform:

Replies:

132862 Sep 25,2017 09:18 PM Oct 17,2017 12:45 AM Xamarin.Forms 7
loading
Tags: SfListView
Emil
Asked On September 25, 2017 09:18 PM

I am loading data in OnAppearing method of the page using MVVM with ObservableCollection. If I change an item in the list, it will not refresh the ui. Exact same code works using SfDataGrid. I tried Raising Property Changed on Observable collection as well but it doesnt help.If I navigate back and come back to the page again, this time I can see the changed element in my UI. it looks like without removing data, changes are not updated 




Muthu Kumaran Gnanavinayagam [Syncfusion]
Replied On September 26, 2017 06:26 AM

Hi Emil, 
 
Sorry for the inconvenience caused. 
 
We have checked with the reported query “View does not refresh after modifying an item in the list” from our side. Unfortunately the reported issue does not replicate at our end. Based on the provided information we have tried to replicate the issue in our sample by loading data in OnAppearing method of a Page and replaced an list item through Button action. The item gets updated in the view as expected. We have attached the working sample for your reference and you can download it from the below link. 
 
 
Could you please check with the above sample? If the issue still reproduces at your end, could you please update the below details or else modify the above sample to replicate the issue?. So that we could analyze the issue better and update an appropriate solution. 
 
  1. If you are updating any property value of the your underlying data, then your Model class should implement the INotifyPropertyChanged and raise the PropertyChanged for that property.
  2. Whether you have set AutoFitMode of SfListView as Height?
 
Please let us know If you require further assistance. 
 
Regards, 
G.Muthu Kumaran. 


Emil
Replied On September 26, 2017 06:58 AM

Hi Muthu,

it implements AutoFitMode="Height" but my Properties of the model doesnt implement RaisedOnPropertyChanged. Without doing it, it works in SfDataGrid, I wonder why it works for SfDataGrid and doesnt work for SfListView. 

thanks,


Emil


Muthu Kumaran Gnanavinayagam [Syncfusion]
Replied On September 27, 2017 12:54 PM

Hi Emil, 
 
Sorry for the inconvenience. 
 
We have checked the reported issue with SfDataGrid sample using similar scenario and the view refreshes only after implementing the INotifyPropertyChanged in the data model and raised the PropertyChanged event for each property in the data model.  So, could you please check by implementing the same at your end and if the issue still persists, please share the working SfDataGrid sample which helps us to analyze the issue better and update you an appropriate solution. 
 
Also, please find the UG documentation of SfDataGrid in which they have mentioned about implementing the INotifyPropertyChanged interface for the model class. 
 
 
Please let us know if you require further assistance. 
 
Regards, 
G.Muthu Kumaran 


Jairo Martins Marques
Replied On October 13, 2017 05:48 PM

Hi Emil, 
 
Sorry for the inconvenience caused. 
 
We have checked with the reported query “View does not refresh after modifying an item in the list” from our side. Unfortunately the reported issue does not replicate at our end. Based on the provided information we have tried to replicate the issue in our sample by loading data in OnAppearing method of a Page and replaced an list item through Button action. The item gets updated in the view as expected. We have attached the working sample for your reference and you can download it from the below link. 
 
 
Could you please check with the above sample? If the issue still reproduces at your end, could you please update the below details or else modify the above sample to replicate the issue?. So that we could analyze the issue better and update an appropriate solution. 
 
  1. If you are updating any property value of the your underlying data, then your Model class should implement the INotifyPropertyChanged and raise the PropertyChanged for that property.
  2. Whether you have set AutoFitMode of SfListView as Height?
 
Please let us know If you require further assistance. 
 
Regards, 
G.Muthu Kumaran. 


Hi Muthu,

after update this sample project to Xamarin Forms 2.4.0.282 and SfListView to version 15.3.0.33, the project do not compile any more.

Error message:

.../Xamarin.Android.Support.v7.AppCompat/library_project_imports/res/values-v26/values-v26.xml: Error APT0000: 1: error: Error: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'. (APT0000) (Grouping.Droid)

.../Xamarin.Android.Support.Design/library_project_imports/res/values-v26/values-v26.xml: Error APT0000: 1: error: Error: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'. (APT0000) (Grouping.Droid)

Could you check, please?

Regards,

Jairo Marques


Muthu Kumaran Gnanavinayagam [Syncfusion]
Replied On October 16, 2017 03:20 AM

Hi Jairo,   
   
We have updated our sample to latest version of Xamarin.Forms(v2.4.0.282) and SfListView(v15.3.0.33). Unfortunately, we didn’t face any errors while compiling the project. For your reference, we have attached the sample link below.   
   
   
Can you please check with the attached sample whether the same issue occurs in attached sample also? If the issue persists, please clean the project by deleting the binobj folders in your solution projects.   
   
Regards,   
G. Muthu Kumaran  
 


Jairo Martins Marques
Replied On October 16, 2017 12:49 PM

Muthu,

this version works fine.

Thanks,

Jairo Marques



Muthu Kumaran Gnanavinayagam [Syncfusion]
Replied On October 17, 2017 12:45 AM

Hi Jairo, 
 
Thanks for the update. 
 
Regards, 
G.Muthu Kumaran. 


CONFIRMATION

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.

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.

;