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

Change mode of RadDataForm with MVVM

3 Answers 218 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Johannes
Top achievements
Rank 1
Johannes asked on 25 Jun 2014, 07:53 AM
I use MVVM and I didn't find out yet how to set RadDataForm in "AddNewItem" or "Edit" mode via ViewModel. There is a property "Mode" of type "RadDataFormMode" and it would be great if I can change that property in ViewModel and bind the View to that but sadly it has no setter. So how to achieve this in a MVVM friendly way?

3 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 30 Jun 2014, 07:22 AM
Hi,

Indeed, the Mode property is a ReadOnly.
What I can suggest you invoking the proper RadDataFormCommands (for example RadDataFormCommands.AddNew) in code.

Regards,
Didie
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Johannes
Top achievements
Rank 1
answered on 01 Jul 2014, 07:52 AM
For the moment I use a custom DataFormCommandProvider and invoke the commands as you suggested but that makes it necessary to import some Telerik stuff into my ViewModel project and I don't like that. Until now my ViewModel project was a Portable Class Library so I can use it with a Telerik WPF UI and a non-Telerik Windows Phone UI. Now I have to use separate ViewModel projects just because there is no way to set the RadDataForms mode directly. That works but as I said it would be great if we can just set the Mode property to another value.
0
Accepted
Dimitrina
Telerik team
answered on 02 Jul 2014, 09:02 AM
Hi,

Thank you for sharing your feedback. We will consider it for the future versions.

Regards,
Didie
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
DataForm
Asked by
Johannes
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Johannes
Top achievements
Rank 1
Share this question
or