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.
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.
Interesting, but how to do when the dropdown list value only can be determine in runtime, means every comboxbox dropdown is depend on the value in another column. and there the dropdown can be a combobox or calendar control depend on the other column
In this case, you should handle the events of opening dropdown/ selecting values and find the next element, that is dependant on the current one. You can use our helper method Utilities.GetAncestorFromType/ GetDescendantFromType to do that.