views:

28

answers:

1

The below code works for a DataGridComboBoxColumn, but ComboBox doesn't have a SelectedValueBinding property. What should I use instead?

<ComboBox
    Header="Application"  
    SelectedValueBinding="{Binding ApplicationKey}" 
    SelectedValuePath="ApplicationKey"  
    DisplayMemberPath="ApplicationName"  
    ItemsSource="{Binding Source={x:Static app:ApplicationLookup.GetAllOrNone}}"/> 
+1  A: 

Use
SelectedValue = {Binding Property}
or SelectedItem = {Binding Property}

these will have the same effect
and to get the Path that you want to display use
DisplayMemberPath = Property

TerrorAustralis
Now why couldn't the datagrid be that easy? Oh well, thanks for your help.
Jonathan Allen