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

Thread is closed for posting
2 posts, 0 answers
  1. Cameron
    Cameron avatar
    5 posts
    Member since:
    Nov 2015

    Posted 24 Nov 2015 Link to this post

    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?

  2. Adrian
    Adrian avatar
    174 posts

    Posted 25 Nov 2015 Link to this post

    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.

    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
Back to Top