I have a number of combo boxes in a window that I need to setup two-way binding on, however I can't seem to figure out how to do it. I have successfully set up basic binding to fill the control where I have the ItemsSource="{Binding}" and I set my DataContext in my C# code behind. I also have two-way binding working on all of the other controls in the window
Let's say I have an object and I am returning an ObservableCollection of it and I want to display Name which is a string. I want the value member to be an ID which is an integer. Is there a code snipped you can please provide that shows how to do two way binding on the ID? I can't seem to find a ValueMember property anywhere, and basically XamComboBox binding is a mystery for me.
Thank you for a very simple and basic xaml code snippet.
Hello Mike,
I have created a sample application for you following your scenario. I have added a XamDataGrid with Patient objects in it and UnboundField with a button which opens another window that displays details to the Patient that corresponds the record. In the details window I have bound every property of the Patient to a TextBox, except the Clinic property which is bound to the SelectedItem of a XamComboEditor. In the MainWindow in the XamDataGrid, there is a UnboundField called “Clinic Name” which is bound to the Clinic.Name of the Patient. You can see that when you change the selected item of the XamComboEditor, the “Clinic Name” field in the XamDataGrid changes its value, because of the two-way binding.
If you have any further questions on the matter please do not hesitate to ask.
Sincerely,
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Krasimir,
I can't open the project. I clicked on the solution and got an error that the project could not load. Then I opened the project directly and all of the files have the yellow triangle warning icon and when I click on any file it tells me that it does not exist in the project directory.
Must have been the way I extracted the solution. I extracted it again, and it's now working. I can see what you did and am studying it. I'll have some questions for you in a bit. This was very helpful. Thank you.