BringItemIntoView is not working

2 posts, 0 answers
  1. Nijith P
    Nijith P avatar
    1 posts
    Member since:
    Nov 2009

    Posted 11 Jan 2013 Link to this post

    trTarget is my RadTreeView name. 

    trTarget.SelectedItem = item;
    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.
  2. Pavel R. Pavlov
    Pavel R. Pavlov avatar
    1167 posts

    Posted 15 Jan 2013 Link to this post

    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

    Pavel R. Pavlov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
Back to Top