TreeView inside ComboBox

5 posts, 1 answers
  1. Joseph LeBlanc
    Joseph LeBlanc avatar
    5 posts
    Member since:
    Sep 2009

    Posted 28 Apr 2010 Link to this post

    Hi,

    For a while now I've been using a TreeView inside of a ComboBox that I got from the Telerik blog here http://blogs.telerik.com/valerihristov/posts/09-08-27/treeview_in_combobox_take_3_silverlight_3_wpf_and_radcontrols.aspx

    It was working fine up until recently when we updated to the latest version of the Telerik WPF controls (Q1 2010). Now what happens is the ComboBox will no longer display the text of the chosen item, it remains blank and I can't figure out why.

    Any help is greatly appreciated, thanks!

    Joe,
  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 03 May 2010 Link to this post

    Hello Joseph,

    I would strongly recommend using RadDropDownButton instead of RadComboBox for such scenarios. This way you could put the TreeView inside the dropdown without customizing control templates:
    http://demos.telerik.com/silverlight/#Buttons/DropDownButton

    If the change is impossible for you, please, let me know and I will try to prepare a sample.

    All the best,
    Valeri Hristov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Joseph LeBlanc
    Joseph LeBlanc avatar
    5 posts
    Member since:
    Sep 2009

    Posted 03 May 2010 Link to this post

    Is the RadDropDownButton available for WPF? I'm not using Silverlight in this particular application.
  5. Answer
    Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 04 May 2010 Link to this post

    Hello Joseph,

    Sorry for the wrong link. Yes, the DropDownButton is available for WPF:
    http://demos.telerik.com/wpf/?/Buttons/DropDownButton

    Sincerely yours,
    Valeri Hristov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Joseph LeBlanc
    Joseph LeBlanc avatar
    5 posts
    Member since:
    Sep 2009

    Posted 04 May 2010 Link to this post

    Awesome, thanks!

    I'll definitely look at switching over to that new control, but I did manage to fix the issue with what I'm using now. In the content presenter I had to change the ContentTemplate to use the ItemTemplate instead of the SelectionBoxItemTemplate, as the SelectionBoxItemTemplate wasn't being set to the correct data template.

    <ContentPresenter x:Name="ContentPresenterElement"
            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
            Margin="{TemplateBinding Padding}" IsHitTestVisible="False"
            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
            ContentTemplate="{TemplateBinding ItemTemplate}"
            Content="{Binding SelectedValue, ElementName=treeView}" />
Back to Top
UI for WPF is Visual Studio 2017 Ready