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

TreeView in Combobox - Existing Sample from Blog not working

1 Answer 73 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Daniel Knoll
Top achievements
Rank 1
Daniel Knoll asked on 18 May 2015, 01:38 PM

Hi,

I'm trying to fit a TreeView into a Combobox. There are already many threads which all refer to this blog post:

http://blogs.telerik.com/xamlteam/posts/10-05-12/treeview-in-combobox-with-radcontrols-for-silverlight-or-wpf-final-take.aspx

Unfortunately, the example is not working (anymore?) in WPF.

There seems to be a problem with the converter. In Silverlight, everything works fine, in WPF however, the converter is called, even when you open the DropDown (which does not happen in Silverlight). In this converter call, the "return false" condition is triggered and so the popup never opens. 

Can you provide a new sample on how to fit a TreeView into a ComboBox (or DropDownButton)?

Best regards 

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Kalin
Telerik team
answered on 21 May 2015, 11:47 AM
Hello Daniel,

Indeed the converter doesn't work correctly for WPF - however we don't have a newer version of this example. What I can suggest you would be to manually close the drop down once the SelectedItem in the TreeView changes. You can do that in MVVM way by binding the SelectedItem and IsOpen to the ViewModel and changing the IsOpen whenever SelectedItem changes. Or you can simply hook to the SelectionChanged event and manually close the drop down:

private void TreeView_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
    this.DropDownButton.IsOpen = false
}

Hope this helps.

Regards,
Kalin
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
ComboBox
Asked by
Daniel Knoll
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Share this question
or