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

Location of Each Node

1 Answer 105 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Erik
Top achievements
Rank 1
Erik asked on 16 Jul 2008, 09:57 AM
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

1 Answer, 1 is accepted

Sort by
0
Jordan
Telerik team
answered on 18 Jul 2008, 12:15 PM
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
Tags
Treeview
Asked by
Erik
Top achievements
Rank 1
Answers by
Jordan
Telerik team
Share this question
or