Bind to ComboBox


  • I am trying to bind a property of my business object to a ComboBox, but I am not having much success. I have already bind data to a TextBox easily, but I am having problem with the ComboBox. The ComboBox ItemsSource is set to one of my business object that contains all the selections. This is working fine, I can see all the selection is my ComboBox. The selected value of the ComboBox is binded to a Guid property of another business object (IndividualLanguageTypeId property)

    Here is the XAML of my ComboBox :

    <ComboBox SelectedValue="{Binding IndividualLanguageTypeId}" x:Name="ComboBox5" IsSynchronizedWithCurrentItem="True" DisplayMemberPath="Description" SelectedValuePath="IndividualLanguageTypeId" SelectionChanged="OnComboBox5SelectionChanged" />

    If I debug the code in the event OnComboBox5SelectionChanged, I can notice that the SelectedValue is always to null. But the SelectedIndex value is OK.

    Can somebody help me with this???




    Monday, October 16, 2006 7:27 PM

All replies