SfDataGrid not updating cell value when edited on Android

Hi there,

We are using the latest stable version of SyncFusion's SfDataGrid for Xamarin.Forms. On Android only when using the editable mode after tapping on a cell and entering text then tapping elsewhere the text disappears (but the underlying value is changed). When you tap the cell to edit again the text entered appears again. This is using the following grid column type:

<dg:GridTextColumn MappingName="ItemDescription.Value" HeaderText="Description" />

On iOS and Windows (UWP) once you are finished typing in a cell and tap elsewhere the text you entered stays in that cell but on Android it disappears.

This also happened on older versions of SfDataGrid and trying several different versions doesn't seem to fix it.

3 Replies

KK Karthikraja Kalaimani Syncfusion Team February 20, 2020 12:57 PM UTC

Hi Kevin,

Thank you for contacting Syncfusion support.

We have checked your reported issue “Edited value does not appears for complex properties in Android”  and we suspect that maybe you have missed to implement the INotifyPropertyChanged on your underline collection. “INotifyPropertyChanged” Which is helps to update the collection and property at runtime.  
  
If you bound the complex property, the changes will not reflect in UI so we must to implement the NotificationObject to respective property to reflect the changes in view. For both implementation we have provided the codes in below code snippet please refer in it.  

Code Example,
 
public class OrderInfo : INotifyPropertyChanged 
{
…..
private CustomerInfo customersinfo;
…..
public CustomerInfo CustomersInfo 
        { 
            get { return customersinfo; } 
            set { this.customersinfo = value; 
                 
                this.CustomersInfo.PropertyChanged += CustomersInfo_PropertyChanged; 
            } 
        } 
 
        private void CustomersInfo_PropertyChanged(object sender, PropertyChangedEventArgs e) 
        { 
            RaisePropertyChanged("CustomersInfo." + e.PropertyName); 
        }
….
}
 
}

public class CustomerInfo : NotificationObject 
    { 
        private string firstName; 
        private string lastName; 
 
        public string FirstName 
        { 
            get 
            { return firstName; 
            } 
            set 
            { 
                this.firstName = value; 
                RaisePropertyChanged("FirstName"); 
            } 
        } 
 
        public string LastName 
        { 
            get { return lastName; } 
            set { this.lastName = value; RaisePropertyChanged("LastName"); } 
        } 
 
        public event PropertyChangedEventHandler PropertyChanged; 
 
        private void RaisePropertyChanged(String Name) 
        { 
            if (PropertyChanged != null) 
                this.PropertyChanged(this, new PropertyChangedEventArgs(Name)); 
        } 
    } 
 
 
Sample link :  https://www.syncfusion.com/downloads/support/directtrac/general/ze/DataGridDemo652154805.zip

We hope this helps. Please let us know, if you need any further assistance.

Regards,
Karthik Raja
 



KE Kevin February 24, 2020 04:27 PM UTC

Hi Karthik,

Thanks for the provided code samples. I can confirm having applied this change the cells now retain the data afterwards. Thanks for your help.

Best Regards.


MK Muthu Kumaran Gnanavinayagam Syncfusion Team February 25, 2020 03:53 AM UTC

Hi Kevin, 
 
Thanks for the update. 
 
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you. 
 
Regards, 
G.Muthu kumaran. 


Loader.
Up arrow icon