This is a migrated thread and some comments may be shown as answers.

TreeView inside ComboBox

4 Answers 680 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Joseph LeBlanc
Top achievements
Rank 1
Joseph LeBlanc asked on 28 Apr 2010, 05:14 PM
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,

4 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 03 May 2010, 11:44 AM
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.
0
Joseph LeBlanc
Top achievements
Rank 1
answered on 03 May 2010, 06:25 PM
Is the RadDropDownButton available for WPF? I'm not using Silverlight in this particular application.
0
Accepted
Valeri Hristov
Telerik team
answered on 04 May 2010, 07:49 AM
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.
0
Joseph LeBlanc
Top achievements
Rank 1
answered on 04 May 2010, 04:53 PM
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}" />
Tags
ComboBox
Asked by
Joseph LeBlanc
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Joseph LeBlanc
Top achievements
Rank 1
Share this question
or