Reputation: 61
i have the following combobox
<ComboBox Grid.Column="1" HorizontalAlignment="Stretch"
Text="{Binding GroupInvoicing.AdminInvoiceBreakdownMembership}"
SelectedValuePath="Tag" SelectedValue="{Binding Path=GroupInvoicing.AdminInvoiceBreakdownMembership}">
<ComboBoxItem Content="None" Tag="N" />
<ComboBoxItem Content="Level of Cover" Tag="L" />
<ComboBoxItem Content="Members" Tag="M" />
<ComboBoxItem Content="Payment Type" Tag="P" />
<ComboBoxItem Content="Work Area" Tag="W" />
</ComboBox>
althogh the GroupInvoicing.AdminInvoiceBreakdownMembership comes back with "L" it does not select the coresponding text and doesn't let me to select anything
d:DataContext="{d:DesignInstance ViewModels:CompanyInvoiceConfigAdminViewModel}"
in viewmodel i have
public GroupInvoicing GroupInvoicing
{
get
{
return this.groupInvoicing;
}
set
{
if (value != null)
{
this.groupInvoicing = value;
this.OnPropertyChanged(() => this.GroupInvoicing);
}
}
}
AdminInvoiceBreakdownMembership is a string
Upvotes: 0
Views: 1149
Reputation: 3428
I believe you can't bind Text and SelectedValue to the same property. Try to remove the Text binding.
Upvotes: 3