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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Unable to save user inputs into the grid

Thread ID:





148351 Oct 16,2019 08:39 AM UTC Oct 17,2019 11:44 AM UTC Xamarin.Forms 1
Tags: SfDataGrid
Asked On October 16, 2019 08:39 AM UTC

So I'm trying to learn the basics of the DataGrid and I have hit a little bit of a barrier. So I have successfully made a grid and it worked perfectly but I decided I would like to make it so a user could edit a cell and change its contents. So I added AllowEditing="True" to the SfDataGrid and it allowed me to change inputs on the grid but when I go back a page and then back to the grid page it hasn't kept the changes.

So basically I'm after a way so that when a user changes a cell it is saved so next time the page opens it has the updated grid.
I followed Syncfuisions video on Datagrid (https://www.youtube.com/watch?v=rdPStxCSy5w&t=139s) so my code is pretty much that but I have added in AllowEditing.

Just trying to learn it all so would be great if someone could explain how to get user inputs to save.

Balasubramani Sundaram [Syncfusion]
Replied On October 17, 2019 11:44 AM UTC

Hi Tom,    
Thanks for contacting Syncfusion support.     
Your requirement to have a common view model for all page to maintain the data to perform CRUD operation can be achieved by using the static view model to access it anywhere in your application without updating when navigation to another page.  
Please refer the below sample and code snippet.  
Code Snippet [C#]   
public App()   
    MainViewModel._ViewModel = new ViewModel();   
public static class MainViewModel   
    public static ViewModel _ViewModel { getset; }   
    <x:Binding Source="{x:Static local:MainViewModel._ViewModel}"/>   
Please let us know, if you require further other assistance from us.   
Balasubramani Sundaram 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon