Propertychanged for DataObject

Hi,
I'm testing the new Dataform control. Everything works fine. Defined a model with some properties , filled it from database in viewmodel and it is perfectly shown (with database values) with the dataform control in the view.
But I have problems to update the view after the user makes some input. Dependent on manual input in property A via view, I have to calculate the value of property B.
I implemented an event for propertychanged in the model and the event was raised in viewmodel (after changing the value of property A manually).
In viewmodel I computed the value for property B and updated the dataobject of the dataform. In debug mode I can see, that the dataobject (model) is filled correctly.

But the new value for property B isn't shown in the view. What is the right way, to update the dataform view with (via code) updated data?

Thank you in advance
Thomas

3 Replies

JM Jeyasri M Syncfusion Team May 17, 2018 08:18 AM UTC

Hi Thomas,   
 
Thanks for contacting Syncfusion support.  
 
We have checked your query and when you change the underlying object value programmatically, You should invoke the SfDataForm.UpdateEditor method to update the editor value at  runtime.  
 
Please refer the below code example: 
 
         private void Populate()  
        {  
            Item.Value = "Value";  
  
            // Pass the corresponding propertyname as parameter to update the value in editor.  
            DataForm.UpdateEditor(“Value”);  
        }  
 
  
Please refer the below link for more details. 
 
 
Regards,  
  
Jeyasri M  



TH Thomas May 17, 2018 09:34 AM UTC

Ah, ok thanks! Works perfectly!


JM Jeyasri M Syncfusion Team May 18, 2018 04:07 AM UTC

Hi Thomas, 
 
We glad to know that the given solution works for you. Please let us know if you need any further assistance. 
 
Regards, 
Jeyasri M 


Loader.
Up arrow icon