GithubHelp home page GithubHelp logo

syncfusionexamples / save-or-cancel-dataform-data-xamarin Goto Github PK

View Code? Open in Web Editor NEW
0.0 5.0 1.0 576 KB

This repository contains a sample on How to save or cancel the edited data in the Syncfusion Xamarin.Forms Dataform (SfDataform)?

C# 100.00%
dataform sfdataform xamarin xamarin-forms dataobject savedata canceldata

save-or-cancel-dataform-data-xamarin's Introduction

How to save or cancel the edited DataForm data in Xamarin.Forms (SfDataForm) ?

You can save or cancel the DataObject in Xamarin.Forms SfDataForm by storing the dataobject.

You can refer the following article.

https://www.syncfusion.com/kb/11312/how-to-save-or-cancel-the-edited-dataform-data-in-xamarin-forms-sfdataform

C#

Raise the property change event to store the DataObject.

private void DataForm_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
    if(e.PropertyName == "DataObject")
    formModel = dataForm.DataObject as DataFormModel;
}

C#

Cancel will reset the DataObject with stored dataobject.

private void OnCancel(object sender, EventArgs e)
{
    dataForm.DataObject = formModel;
    foreach (var property in dataForm.DataObject.GetType().GetProperties())
    {
        dataForm.UpdateEditor(property.Name);
    }
}

C#

Saves the edited data by using Commit method.

private void OnSaved(object sender, EventArgs e)
{
    dataForm.Validate();
    dataForm.Commit();
    formModel = dataForm.DataObject as DataFormModel;
}

save-or-cancel-dataform-data-xamarin's People

Contributors

jayaleshwari avatar sarubala20 avatar syncfusionbuild avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

vishalomprasad

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.