TreeView inside combobox.

3 posts, 0 answers
  1. Alexey
    Alexey avatar
    79 posts
    Member since:
    Oct 2008

    Posted 03 Apr 2010 Link to this post

    I've read valeri hristov post about it: http://blogs.telerik.com/valerihristov/posts/09-08-27/treeview_in_combobox_take_3_silverlight_3_wpf_and_radcontrols.aspx

    Everything is work nice expect SelectionBoxTemplate. It is not applied and that is why insted of text, class name of data item apper.

    I'm using Silverligh 4 RC build.
  2. Alexey
    Alexey avatar
    79 posts
    Member since:
    Oct 2008

    Posted 03 Apr 2010 Link to this post

    Valeri. I've got some modifications to your approach.

    For combobox i have introduced attached property HierarchicalSelectedItem and then bind it to treeview inside its template

    <Controls:RadTreeView x:Name="TreeViewSelector"
                                                              ItemTemplate="{TemplateBinding ItemTemplate}"
                                                              ItemsSource="{TemplateBinding ItemsSource}"
                                                              SelectedItem="{Binding RelativeSource={RelativeSource TemplatedParent},Path=(CBTV:ComboBoxExtensions.HierarchicalSelectedItem), Mode=TwoWay}"/>  

    What you think about that?

  3. DevCraft banner
  4. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 07 Apr 2010 Link to this post

    Hi Alexey,

    Your modification looks very nice, thank you for the heads-up. By the way, using RadDropDownButton you could achieve the same effect, without the need to retemplate RadComboBox, thus with very few lines of code. Please, let me know if you need a sample.

    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.
Back to Top