We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Treeview getCheckedNodes() doesn't always return parent nodes...

Thread ID:





128252 Jan 10,2017 10:51 PM UTC Jan 11,2017 01:52 PM UTC ASP.NET Web Forms 1
Tags: TreeView
Marc Call
Asked On January 10, 2017 10:51 PM UTC

When calling getCheckedNodes() with a fully selected treeview, all nodes are returned.

However if one of the children nodes is NOT selected (as seen below)

The top most node and its immediate child are NOT returned.
I assume this works as intended, but I need to get those top nodes returned.

How can I get all nodes returned that have a check mark or a square in them??

Ashokkumar Balasubramanian [Syncfusion]
Replied On January 11, 2017 01:52 PM UTC

Hi Marc, 
We are unable to check the provided screenshot, since it is unclear. However, we can understand your requirement to retrieve the nodes which have checked and Indeterminate state. You can get only the checked nodes using the method "getCheckedNodes". To get both checked and Indeterminate node, please use the below code in your application instead of getCheckedNodes method. 

// TreeView control object creation  

var treeViewObj = $("#treeView").ejTreeView("instance"); 
// To get both checked and Indeterminate node 
var nodes = treeViewObj._liList.find('> div > .e-chkbox-wrap[aria-checked="mixed"],> div > .e-chkbox-wrap[aria-checked="true"]').closest('.e-item'); 

For your reference, we have prepared sample with your requirement, it can be downloaded from below location. 

Please let us know, if you require any further assistance. 

Ashokkumar B. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon