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

treeview in combobox -> BringItemIntoView

2 Answers 75 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
iramz
Top achievements
Rank 1
iramz asked on 23 Feb 2010, 03:19 AM
hello,

i tried using the below implementation of radtreeview

http://blogs.telerik.com/blogs/posts/09-08-27/treeview_in_combobox_take_3_silverlight_3_wpf_and_radcontrols.aspx

however, i try to use BringItemIntoView to show a specific item when combobox dropdown opens, but the selected item is still not in the view. i can control the treeview to expand and all, but the item i want to be visible is still out of view (need to scroll down). any idea?

thank you!

2 Answers, 1 is accepted

Sort by
0
iramz
Top achievements
Rank 1
answered on 23 Feb 2010, 03:21 AM
here is how i control it on my TreeViewComboBox.cs

protected override void OnDropDownOpened(EventArgs e)  
        {  
            base.OnDropDownOpened(e);  
            if (treeView != null && this.SelectedItem != null)  
            {  
                treeView.ExpandAll();  
                treeView.BringItemIntoView(this.SelectedItem);  
            }  
        }  
 
        public void treeView_SelectionChanged(object sender, SelectionChangedEventArgs e)  
        {  
            treeView = sender as RadTreeView;                               
        } 
0
Miroslav
Telerik team
answered on 25 Feb 2010, 03:13 PM
Hi iramz,

The BringItemIntoView method only works for the immediate children of the TreeView. We have mentioned this in the summary of the method but I agree that it can be misleading.

I answered here how you can expand to an item;

http://www.telerik.com/community/forums/silverlight/treeview/expand-specific-item.aspx

You can obtain an item by calling the GetItemByPath() method and then call its item.BringIntoView method.

Sincerely yours,
Miroslav
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.
Tags
TreeView
Asked by
iramz
Top achievements
Rank 1
Answers by
iramz
Top achievements
Rank 1
Miroslav
Telerik team
Share this question
or