I have seen a lot of topic about creating a ComboBox using TreeView but not with an Editable one (the topics shows things with no use of ComboBoxes).
I am currently using the ComboBox with a Grid Panel.
Here is the XAML I am currently using :
<Window x:Class="DandDAdventures.XAML.AddPJWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:DandDAdventures.XAML"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
mc:Ignorable="d"
Title="Example" Height="300" Width="300">
<DockPanel>
<Grid VerticalAlignment="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
<RowDefinition Height="1*"/>
</Grid.RowDefinitions>
<ComboBox Grid.Column="1" Grid.Row="2" IsEditable="True" x:Name="RaceCB">
<ComboBoxItem HorizontalAlignment="Stretch">
<TreeView ItemsSource="{Binding Children}" x:Name="RaceTV" SelectedItemChanged="RaceTVSelectedItemChanged" >
<TreeViewItem Header="Hello">
<TreeViewItem Header="HelloLvl2"/>
</TreeViewItem>
</TreeView>
</ComboBoxItem>
<ComboBox.Text>
<Binding Path="SelectedItem.Header" ElementName="RaceTV" Mode="OneWay"/>
</ComboBox.Text>
</ComboBox>
</Grid>
</DockPanel>
</Window>
When I have selected an Item, the ComboBox shows "System.Windows.Controls.ComboBoxItem"
I don't know what to do and I need the ComboBox to be editabled.
Thank you a lot !