TreeComboBox ClassDW.WPFToolkit Documentation
Represents a ComboBox which shows a tree view in the drop down.
Inheritance Hierarchy

SystemObject
  System.Windows.ThreadingDispatcherObject
    System.WindowsDependencyObject
      System.Windows.MediaVisual
        System.WindowsUIElement
          System.WindowsFrameworkElement
            System.Windows.ControlsControl
              System.Windows.ControlsItemsControl
                System.Windows.ControlsTreeView
                  DW.WPFToolkit.ControlsTreeComboBox

Namespace: DW.WPFToolkit.Controls
Assembly: DW.WPFToolkit (in DW.WPFToolkit.dll) Version: 5.6.0.0
Syntax

C#
public class TreeComboBox : TreeView

The TreeComboBox type exposes the following members.

Constructors

  NameDescription
Public methodTreeComboBox
Initializes a new instance of the TreeComboBox class.
Top
Methods

  NameDescription
Public methodOnApplyTemplate
The template gets added to the control.
(Overrides FrameworkElementOnApplyTemplate.)
Protected methodOnSelectedItemChanged
Sets the current selected item of the selection in the tree has been changed and closed the drop down.
(Overrides TreeViewOnSelectedItemChanged(RoutedPropertyChangedEventArgsObject).)
Top
Fields

  NameDescription
Public fieldStatic memberIsDropDownOpenProperty
Identifies the IsDropDownOpen dependency property.
Public fieldStatic memberMaxDropDownHeightProperty
Identifies the MaxDropDownHeight dependency property.
Public fieldStatic memberSelectionBoxItemProperty
Identifies the SelectionBoxItem dependency property.
Public fieldStatic memberSelectionBoxItemStringFormatProperty
Identifies the SelectionBoxItemStringFormat dependency property.
Public fieldStatic memberSelectionBoxItemTemplateProperty
Identifies the SelectionBoxItemTemplate dependency property.
Top
Properties

  NameDescription
Public propertyIsDropDownOpen
Gets or sets a value that indicates of the drop down is opened or not.
Public propertyMaxDropDownHeight
Gets or sets the maximum height of the drop down popup. This is taken from the calculated height of the original MaxDropDownHeight.
Public propertySelectionBoxItem
Gets or sets the item shown as selected.
Public propertySelectionBoxItemStringFormat
Gets or sets string format of the selected item. This is taken from the original SelectionBoxItemStringFormat.
Public propertySelectionBoxItemTemplate
Gets or sets data template of the selected item. This is taken from the original SelectionBoxItemTemplate.
Top
Examples

XAML
<Toolkit:TreeComboBox ItemsSource="{Binding Customers}" SelectionBoxItem="{Binding SelectedCustomer}">
    <Toolkit:TreeComboBox.ItemContainerStyle>
        <Style TargetType="{x:Type TreeViewItem}">
            <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
        </Style>
    </Toolkit:TreeComboBox.ItemContainerStyle>
    <Toolkit:TreeComboBox.SelectionBoxItemTemplate>
        <DataTemplate>
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Name}" />
                <TextBlock Text="{Binding FamilyName}" Margin="5,0,0,0" />
            </StackPanel>
        </DataTemplate>
    </Toolkit:TreeComboBox.SelectionBoxItemTemplate>
    <Toolkit:TreeComboBox.ItemTemplate>
        <HierarchicalDataTemplate ItemsSource="{Binding Customers}">
            <TextBlock Text="{Binding Name}" />
        </HierarchicalDataTemplate>
    </Toolkit:TreeComboBox.ItemTemplate>
</Toolkit:TreeComboBox>
See Also

Reference