Highlight a node selected by code

4 posts, 0 answers
  1. Juan Pablo
    Juan Pablo avatar
    19 posts
    Member since:
    Oct 2008

    Posted 30 Jan 2009 Link to this post

    Hello experts!

    I have an application where there are 2 treeviews, each one is in a tab item.
    When I do a double click in one of the nodes of the second treeview, the application search for it's twin in the first node and show some information in the form.
    The application is finding the node, is expanding the treeview and scrolling to show the node (I'm using treeview1.bringintoview(node) functionality). But I need to the node get's highlighted as if it was selected with the mouse.

    Please help me with this, I've worked on this for hours and can't get any solution. I've also used the treevie1.setfocus(node), but it doesn't work.

    Thanks in advance.
  2. Juan Pablo
    Juan Pablo avatar
    19 posts
    Member since:
    Oct 2008

    Posted 30 Jan 2009 Link to this post

    Nevermind ... I changed the order of some code lines and it worked ...

    Thanks!
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Christian
    Christian avatar
    81 posts
    Member since:
    Aug 2008

    Posted 20 Jul 2009 Link to this post

    Hi,
    I have a similar problem and still no solution. For a tip, I would be grateful.
    Christian


  5. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 23 Jul 2009 Link to this post

    Hi Christian,

    In order to achieve the desired functionality, you should simply use the following code snippet:
    this.radTreeView2.BringIntoView(searchedNode);  
    this.radTreeView2.SelectedNode = searchedNode; 

    The searchedNode is the RadTreeNode of interest.

    If you have additional questions, feel free to contact me.

    Kind regards,
    Nikolay
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top