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
2275
Two way binding to a XamComboEditor
posted

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.

Parents
No Data
Reply
  • 30945
    Offline posted

    Hello Mike,

     

    Thank you for the clarification and the sample code that you have posted. I have looked into it and I assume that you are using the shared XamComboEditor, which is available in both WPF and Silverlight. If my assumption is correct, you can use the SelectedItem in order to bind the name of the selected item form the XamComboEditor to the Text property of the TextBox, since the XamComboEditor which comes from the Silverlight does not currently expose ValuePath property. I have used the sample code that you have posted and created a sample application in which you can change the Name of the selected Clinic from the TextBox.

     

    If you need any further assistance on the matter please do not hesitate to ask.

     

    Sincerely,

    Krasimir

    Developer Support Engineer

    Infragistics

    www.infragistics.com/support

    ComboItemBinding.zip
Children