Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3231602
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:03:52+00:00 2026-05-17T17:03:52+00:00

I have a combobox which when clicked will show a treeview in the drop

  • 0

I have a combobox which when clicked will show a treeview in the drop down. In the displayed tree view you can check and uncheck treeview items. But when I double click on treeview items I am getting a part of tree view displayed in the editable text box of the combobox. I dont want anything to be displayed there? How to get rid of it

here’s my XAML..

<ComboBox Grid.Column="3" IsEditable="False" Grid.Row="1" Margin="2" ItemContainerStyle="{StaticResource ComboTreeSelectionStyle}" IsEnabled="{Binding SelectedLookIn, Converter={StaticResource LocationToTypeEnabledConverter},UpdateSourceTrigger=PropertyChanged}" MaxDropDownHeight="300" >
                            <TreeView ItemsSource="{Binding Path=SearchFilterTypes}" ItemContainerStyle="{StaticResource TreeViewItemStyle}" HorizontalContentAlignment="Stretch">
                                <TreeView.Resources>
                                    <HierarchicalDataTemplate DataType="{x:Type viewModels:SomeTypeViewModel}" ItemsSource="{Binding Path=Children}">
                                        <CheckBox Content="{Binding Path=Name}" Margin="1" IsChecked="{Binding Path=IsChecked}" />
                                    </HierarchicalDataTemplate>
                                </TreeView.Resources>
                            </TreeView>
                        </ComboBox>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T17:03:52+00:00Added an answer on May 17, 2026 at 5:03 pm

    You will probably need to replace your control template for this combo box and bind the ContentPresenter to the value you want to display:

    <ControlTemplate x:Key="ExclusionsComboBoxTemplate" TargetType="{x:Type ComboBox}">
                    <AdornerDecorator>
                        <Grid>
                            <ToggleButton BorderBrush="#00000000" Focusable="false" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press" Background="#00000000" Style="{x:Null}" />
                            <ToggleButton Grid.Column="2" Template="{DynamicResource ComboBoxToggleButton}" x:Name="ToggleButton" Focusable="false" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press"/>
    
                            <ContentPresenter HorizontalAlignment="Left" Margin="3,3,23,3" x:Name="ContentSite" VerticalAlignment="Center" Content="{Binding Path=SelectedExclusionsCount}" IsHitTestVisible="False"/>
    
                            <TextBox Visibility="Hidden" Template="{DynamicResource ComboBoxTextBox}" HorizontalAlignment="Left" Margin="3,3,23,3" x:Name="PART_EditableTextBox" Style="{x:Null}" VerticalAlignment="Center" Focusable="True" Background="Transparent" IsReadOnly="{TemplateBinding IsReadOnly}"/>
                            <Rectangle x:Name="DisabledVisualElement" Fill="#A5FFFFFF" RadiusX="4" RadiusY="4" IsHitTestVisible="false" Visibility="Collapsed" />
                            <Rectangle x:Name="FocusVisualElement" Margin="-1" Stroke="{DynamicResource selectedStroke}" StrokeThickness="1" RadiusX="4" RadiusY="4" IsHitTestVisible="false" Opacity="0"/>
                            <Popup IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" x:Name="Popup" Focusable="False" AllowsTransparency="True" PopupAnimation="Slide">
                                <Grid MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding ActualWidth}" x:Name="DropDown" SnapsToDevicePixels="True">
                                    <Border x:Name="DropDownBorder" Background="#FFFFFFFF" BorderBrush="{DynamicResource TextBoxNorm}" BorderThickness="1" CornerRadius="1,1,3,3">
                                        <ScrollViewer Margin="4,6,4,6"   SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" CanContentScroll="True">
                                            <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained"/>
                                        </ScrollViewer>
                                    </Border>
                                </Grid>
                            </Popup>
                        </Grid>
                    </AdornerDecorator>
                </ControlTemplate>
    

    I have used this template to make a CheckedList in a combobox, the display in the text section displays how many items are selected

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ComboBox in WPF which is databound, and has data template which
Say I have a DataGridView in which I dynamically build up a ComboBox column
I have a ComboBox which is binded with a List. Consider I have 10
I have a JSON data store used for a combobox selection which is working
I have a combobox where the user can select a particular year (populated by
In WinForm, I have a combobox with DropDownStyle set to DropDownList (so can't enter
Hi all I have a combobox which is databound to a list of elements.
The problem is strange, I have a combobox which is correctly filled with items
Currently we have a makeshift combobox which is comprised of a textbox, an arrow
I have a combo box on a WinForms app in which an item may

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.