Telerik
Home / Support / Knowledge Base / RadControls for ASP.NET and ASP.NET AJAX / TreeView / How to distinguish whether node.get_parent returns the parent node or the parent treeview?

How to distinguish whether node.get_parent returns the parent node or the parent treeview?

Article Info

Rating: 5

Article information

Article relates to

 RadTreeView Prometheus

Created by

 Nick    

Last modified

 01 February, 2008

Last modified by

 Nick


How to destinguish whether node.get_parent returns the parent node or the parent treeview?

Use the following code to check whether a node or a treeview instance is returned by the get_parent() method:

if (node.get_parent() == node.get_treeView())  // node is root node and get_parent() returns the parent treeview 

or test the node level for zero:

if (node.get_level() == 0) //node is root node 

Comments

There are no comments yet.
If you'd like to comment on this KB article, please, send us a Support Ticket.
Thank you!

Please Sign In to rate this article.

Powered by Sitefinity ASP.NET CMS

Contact Us | Site Feedback | Terms of Use | Privacy Policy
Copyright © 2002-2010 Telerik. All rights reserved.