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

TreeNodeUI of RadTreeNode

1 Answer 63 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Zaven Adamyan
Top achievements
Rank 1
Zaven Adamyan asked on 19 Jun 2010, 09:10 PM
Hi,

Is there way to get TreeNodeUI of RadTreeNode?
The code below works only for root nodes, because TreeViewElement.Items returns only root items.

 

private TreeNodeUI FindNodeUI(RadTreeNode node)

 

{

 

TreeNodeUI result = null;

 

 

if (node != null)

 

{

 

foreach (TreeNodeUI item in node.TreeView.TreeViewElement.Items)

 

{

 

if (item.AssociatedTreeNode == node)

 

{

result = item;

 

break;

 

}

}

}

 

return result;

 

}



1 Answer, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 24 Jun 2010, 09:18 AM
Hello Zaven Adamyan,

Thank you for writing.

Finding the TreeNodeUI associated with a RadTreeNode is not possible for every RadTreeNode, because RadTreeView has UI virtualization. There is a fixed number of TreeNodeUI objects that are translated and associated dynamically as the user scrolls the view, therefore you can not get a UI element for a RadTreeNode that is not currently visible.

Please specify what your goal is so that I may provide a suggestion if possible.

Sincerely yours,
Victor
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Treeview
Asked by
Zaven Adamyan
Top achievements
Rank 1
Answers by
Victor
Telerik team
Share this question
or