Problem with SelectedItem of WPF Editable ComboBox with DataTemplate
I’m having the following issue with WPF ComboBox : XAML: <Window.Resources> <ResourceDictionary> <DataTemplate DataType="{x:Type this:Data}"> <ComboBox IsTextSearchEnabled="False" IsEditable="True" Text="{Binding Value}" ItemsSource="{Binding Menu}"/> </DataTemplate> </ResourceDictionary> </Window.Resources> <StackPanel> <ContentControl Content="{Binding}"/> <Button Click="ChangeData_Click">Change Data</Button> </StackPanel> Code behind: public Window1() { InitializeComponent(); DataContext = new Data(); } void ChangeData_Click(object sender, RoutedEventArgs e) { DataContext = new Data(); } I