Articles in this section
Category / Section

How to commit the Edited cell values in Xamarin.Foprms DataGrid view?

1 min read

In SfDataGrid Edited GridCellvalues will be updated in view only if corresponding model class has been implemented from INotifyPropertyChanged and raised PropertyChanged for corresponding model object. Otherwise edited values not updated in view after EndEdit. Please refer the below code example

 

public class OrderInfo : INotifyPropertyChanged
{
    public OrderInfo()
    {
            
    }

    private int _orderID;
    public int OrderID
    {
        get
        {
            return _orderID;
        }
        set
        {
            this._orderID = value;
            RaisePropertyChanged("OrderID");
        }
    }
    public event PropertyChangedEventHandler PropertyChanged;
    private void RaisePropertyChanged(String Name)
    {
        if (PropertyChanged != null)
            this.PropertyChanged(this, new PropertyChangedEventArgs(Name));
    }
}

 

Note: List does not have PropertyChange support so if we use List as SfDataGrid.ItemsSource, then Edited grid cell values not updated. Need to use only support PropertyChanged collection types.

 

Conclusion

I hope you enjoyed learning about how to commit the Edited cell values in Xamarin.Forms DataGrid view.

You can refer to our Xamarin.Forms DataGrid feature tour page to know about its other groundbreaking feature representations. You can also explore our Xamarin.Forms Chart documentation to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied