Posted by: Zeeshan Amjad | October 20, 2009

Embedded Combo Box Inside Tree Control

Due to the flexible architecture of WPF we can easily embed one control inside another. Here is one example to use combo box inside the tree control.

  1: <Window x:Class="objDataProvider.Window1"
  2:     xmlns=""
  3:     xmlns:x=""
  4:     xmlns:System="clr-namespace:System;assembly=mscorlib"
  5:     xmlns:odp="clr-namespace:objDataProvider"
  6:     Title="Combo Inside Tree" Height="300" Width="400">
  8:     <TreeView>
  9:         <TreeViewItem Header="Tree Item 1">
 10:             <ComboBox>
 11:                 <ComboBoxItem>Combo Item 1</ComboBoxItem>
 12:                 <ComboBoxItem>Combo Item 2</ComboBoxItem>
 13:                 <ComboBoxItem>Combo Item 3</ComboBoxItem>
 14:             </ComboBox>
 15:         </TreeViewItem>
 16:         <TreeViewItem Header="Tree Item 2">
 17:             <TreeViewItem Header="Tree Item 2.1"/>
 18:             <TreeViewItem Header="Tree Item 2.2"/>
 19:             <TreeViewItem Header="Tree Item 2.3"/>
 20:             <TreeViewItem Header="Tree Item 2.4"/>
 21:         </TreeViewItem>
 22:     </TreeView>
 23: </Window>

Here is the output of this program




  1. […] already saw couple of examples of combo box. Here we saw combo box inside tree view, here inside list view,  here inside tab control and here […]

  2. can you please help me with the Key Board Navigation ?
    After selecting the combo-box i am not able to select any other elements from the keyboard.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


%d bloggers like this: