Peter Meinl
Top achievements
Rank 1
Peter Meinl
asked on 03 Mar 2010, 06:49 AM
I am using the TreeView in ComboBox from Valeri
http://blogs.telerik.com/valerihristov/posts/09-08-27/treeview_in_combobox_take_3_silverlight_3_wpf_and_radcontrols.aspx
How can I set the selected item programmatically?
I tried
myTreeViewCombo.SelectedTreeViewItem = someItem
and
myTreeViewCombo.SelectedValue = someItem
The item seems to get selected, but the selection does not display in the ComboBox.
http://blogs.telerik.com/valerihristov/posts/09-08-27/treeview_in_combobox_take_3_silverlight_3_wpf_and_radcontrols.aspx
How can I set the selected item programmatically?
I tried
myTreeViewCombo.SelectedTreeViewItem = someItem
and
myTreeViewCombo.SelectedValue = someItem
The item seems to get selected, but the selection does not display in the ComboBox.
4 Answers, 1 is accepted
0
Hello Peter,
RadTreeView cannot automatically select items by setting its SelectedItem/Value properties. To select an item you should find it and set its IsSelected property to true.
Greetings,
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.
RadTreeView cannot automatically select items by setting its SelectedItem/Value properties. To select an item you should find it and set its IsSelected property to true.
Greetings,
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
Peter Meinl
Top achievements
Rank 1
answered on 04 Mar 2010, 05:35 AM
How can I reference the TreeView inside the TreeViewComboBox from code?
0
Accepted
Hi Peter,
I guess that it would be easier if you put RadTreeView inside a RadDropDownButton:
http://demos.telerik.com/wpf/?Buttons/DropDownButton
This way you will be able to directly reference the TreeView and use it as it is on the page.
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.
I guess that it would be easier if you put RadTreeView inside a RadDropDownButton:
http://demos.telerik.com/wpf/?Buttons/DropDownButton
This way you will be able to directly reference the TreeView and use it as it is on the page.
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
Peter Meinl
Top achievements
Rank 1
answered on 04 Mar 2010, 06:48 PM
Thank you for this good suggestion.
However, with a TreeView in DropDownButton I did not know, how to find the DropDownButton the TreeView belongs too on TreeView.SelectionChanged (I create many DropDownButtons dynamically in code).
Thus I gave up on trees and use 2 ComboBoxes instead.
However, with a TreeView in DropDownButton I did not know, how to find the DropDownButton the TreeView belongs too on TreeView.SelectionChanged (I create many DropDownButtons dynamically in code).
Thus I gave up on trees and use 2 ComboBoxes instead.