Location of Each Node

2 posts, 0 answers
  1. Erik
    Erik avatar
    80 posts
    Member since:
    Jul 2007

    Posted 16 Jul 2008 Link to this post

    Dear telerik,

    Before expanded or after expanded, the location of each node will be different.  So how do i know the location of nodes in (x,y)?


    Thanks
  2. Jordan
    Admin
    Jordan avatar
    547 posts

    Posted 18 Jul 2008 Link to this post

    Hello Erik,

    I would suggest you try something like this:
    public Point GetNodeLocation(RadTreeNode node) 
            { 
                foreach (TreeNodeUI treeNodeUI in this.radTreeView1.TreeViewElement.Items) 
                { 
                    if (treeNodeUI.AssociatedTreeNode == node) 
                    { 
                        return treeNodeUI.Location; 
                    } 
                } 
     
                return Point.Empty; 
            } 

    You should note, however, that if the node is not currently shown you will get Point.Empty as result.

    Don't hesitate to contact me if you have further questions.

    All the best,
    Jordan
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top