Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2320
Binding to object contained within a custom CVP in another cell
posted

I have a XamComboBox with a button beside it (created within a custom CellValuePresenter) in one cell of my XamDataGrid. Is there any way to bind another cell in the same record to the selected item of that XamComboBox?

 

The items in the XamComboBox are objects and only one property of those objects becomes the cell's actual value - the DataItem of the record contains this one value and not the whole object, therefore I cannot bind to the DataItem's property.

Parents
  • 69686
    Verified Answer
    posted

     Hello,

    First you need to get the active record in the RecordActivated Event. Using the CellValuePresenter.FromRecordAndField method you can get references to the cellvaluepresenters of the fields that you want to operate with, and after that their correspondent Editors. Then you need to handle the SelectedItemChanged event of the XamComboEditor in the xamDataGrid and perform the logic. It is little bit confusing and hard to follow, so I attach a sample application to illustrate what I have done.

    Hope this helps you. 

     

    testGridComboBox.zip
Reply Children