Data Binding is not working in SFListview

I am using SFListView Control to display the list of filter options

I tried to assign the value to model in listview-clickevent in MyContentPage.xaml.cs. but its not updating in sflistview. i tried multiple ways to update the sflistview like assiging different values to Veiw Cache & data cache but still not working

After all try's i tried Listview control of xamarin form - then all of sudden its working. I tried same code that have used in sflistview to listview control of xamarin forms, its working in listview xamarin control but not sflistview



1 Reply

LN Lakshmi Natarajan Syncfusion Team October 26, 2021 12:07 PM UTC

Hi Anudeep, 
 
Thank you for using Syncfusion products. 
 
We have checked the reported query “Data Binding is not working in SFListview” from our side. We would like to inform you that you can update the property values at runtime in Xamarin.Forms. And we need to invoke the PropertyChanged event for the property to reflect the runtime changes in the UI.  
  
Please refer to the INotifyPropertyChanged interface document form the following link,  
 
public class Contacts : INotifyPropertyChanged 
{ 
            private string contactName; 
 
            public string ContactName 
            { 
                        get { return contactName; } 
                        set 
                        { 
                                    if (contactName != value) 
                                    { 
                                                contactName = value; 
                                                this.RaisedOnPropertyChanged("ContactName"); 
                                    } 
                        } 
            } 
             
 
            public event PropertyChangedEventHandler PropertyChanged; 
 
            public void RaisedOnPropertyChanged(string _PropertyName) 
            { 
                        if (PropertyChanged != null) 
                        { 
                                    PropertyChanged(this, new PropertyChangedEventArgs(_PropertyName)); 
                        } 
            } 
} 
 
 
You can also refer to our user guidance document to implement the INotifyPropertyChanged interface for the model properties and binding properties to the SfListView.ItemTemplate,  
UG links:  
  
You can also refer to our online documentation to update the model data at runtime, 
 
Please let us know if this helps. If you still facing the same issue, please revert us back with the following details which would be helpful for us to check on it and provide you the solution as soon as possible. 
  • Share ListView related code snippets
  • Share Model and ViewModel class
  • Share issue reproducing video
  • Share Syncfusion and Xamarin.Forms versions
  
Regards, 
Lakshmi Natarajan 
  
 


Loader.
Up arrow icon