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

Is it possible to display DataForm with fields containing whatever was last committed/stored?

1 Answer 65 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Cameron
Top achievements
Rank 1
Cameron asked on 24 Nov 2015, 04:21 PM

Hi there-

 

I'm trying to use the DataForm for both a New User sign-up and User edit details pages of an application.

 

I've had a good look at the examples provided and tried my own implementation (trying to set the dataSource.valueCandidate) but this doesn't work.

 

Is there any way to programmatically set the dataForm fields to display a saved value?

1 Answer, 1 is accepted

Sort by
0
Adrian
Telerik team
answered on 25 Nov 2015, 04:28 PM
Hi, Cameron,

Thank you for contacting us.

The editors in TKDataForm display the property's initial value by default. valueCandidate is a property of the TKEntityProperty object that represents a property from your business object and it is used by the data form when you start editing the property's value using the editors. TKEntityProperty also has property called originalValue that represents the current value of your business object's properties and it is read only. If you still need to set initial value for your editors that is different from the initial value of your business object properties you can set the TKEntityProperty valueCandidate like in the code snippet below:
_dataSource[@"password"].valueCandidate = @"password";

I hope this helps. Should you have further questions, do not hesitate to contact us.

Regards,
Adrian
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
Cameron
Top achievements
Rank 1
Answers by
Adrian
Telerik team
Share this question
or