This is a migrated thread and some comments may be shown as answers.

DataForm Binding MVVM

1 Answer 289 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
fenix2222
Top achievements
Rank 2
fenix2222 asked on 06 Jun 2016, 06:28 AM
How can I bind DataForm? I have a button which is outside of the form and I am binding everything to a ViewModel. How do I use form in MVVM fasion? All available methods like ValidateAll, CommitAll etc. are not useful and there is no IsValid property to bind to so taht I know when form is valid? How do I do it? Do I somehow glue it with FormValidationFinished event?

1 Answer, 1 is accepted

Sort by
0
Rosy Topchiyska
Telerik team
answered on 08 Jun 2016, 12:55 PM
Hi Igor,

Thank you for contacting us.

What I understand is that you don't know when the form is valid, so that you could commit your changes. This could vary depending on the validation and commit mode, and you have to be more specific about the scenario you wish to accomplish.

The form does not have IsValid property because on Android validation and committing are asynchronous. This is why we have events that are fired when the asynchronous operations are completed. Depending on the validation mode, you could use two types of events:
  • Immediate/OnLostFocus validation: PropertyValidationCompleted event, which is fired after change in a property editor.
  • Manual validation: FormValidationCompleted event which is fired after ValidateAll() method is called.

I have prepared a sample project that demonstrates how to use a RadDataForm control in a MVVM scenario with immediate validation and commit modes. You can take a look and see if this could help.

Please, let us know if you have further questions.

Regards,
Rosy Topchiyska
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
DataForm
Asked by
fenix2222
Top achievements
Rank 2
Answers by
Rosy Topchiyska
Telerik team
Share this question
or