We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

MultidataBinding

I have a problem
in my ViewModel, i have AProperty as int, B Property as int and CProperty as int
then CProperty = AProperty + BProperty.
then in my datagrid have 3 column by AComlumn Bound to AProperty, BColumn bound to BProperty, CColumn bound to CProperty.
what i want is
when i change value from ACoumn, AProperty and CProperty will changed, and if i change CColumd value, then AColumn and AProperty will change with AProperty = AProperty = CProperty - BProperty. the BProperty is readonly.
I don't know how to do that in synfusion datagid, can anybody can help me, thank.

3 Replies

SS Susmitha Sundar Syncfusion Team August 5, 2019 05:05 PM UTC

Hi Nguyen, 
  
Thank you for using Syncfusion controls. 
  
You can achieve your requirement by Unbound columns of SfDataGrid. In these columns, you can bind your expression. And can commit the editable value to an unbound column by QueryUnboundColumnValue event. We have prepared the sample for the same. Please refer the following sample and User guide link,  
 
 
 
Please contact us for further assistance. 
 
Regards, 
Susmitha S 



NG Nguyen August 6, 2019 11:58 AM UTC

thanks for this help. But i think it's useful when the expression is simple, with more complex expression, the converter with parameter will be better, i custom an converter with can pass BProperty as converter parameter and use it in datagrid column.


FP Farjana Parveen Ayubb Syncfusion Team August 7, 2019 06:11 AM UTC

 
Hi Nguyen, 
 
Thanks for the update. 
 
We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help you. 
 
Regards, 
Farjana Parveen A 


Loader.
Live Chat Icon For mobile
Up arrow icon