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

BringItemIntoView is not working

1 Answer 53 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Nijith P
Top achievements
Rank 1
Nijith P asked on 11 Jan 2013, 09:44 AM
trTarget is my RadTreeView name. 


trTarget.SelectedItem = item;
trTarget.BringItemIntoView(trTarget.SelectedItem);
Is not working for me. 

Can you give me a sample project which does the same.
BRINGPATHINTOVIEW is working for me. But our tree structure is very complicated to get the names of all the parent.
So can you please tel me how to archive the same using BringItemIntoView Method.

1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 15 Jan 2013, 02:55 PM
Hi Nijith,

The BringItemIntoView() method works only for immediate child items, meaning that you can bring items into view which are direct children of the item (or the treeview) where you start searching from. For more information you can take a look at this article. If you want to bring any item into view when you start the search in the RadTreeView control itself (for example) you have to use the BringPathIntoView() method. It is recursive and it calls the BringItemIntoView() method for each Item in the path.
Furthermore, when using BringPathIntoView() , you don't even have to make sure that all items have already been generated - the TreeView forces the generation of containers throughout the given path.

Please take a look at this article demonstrating a way to create the path of all items in the ViewModels. Give it a try and let me know if you have any more questions

Regards,
Pavel R. Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
TreeView
Asked by
Nijith P
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or