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. Image for the cookie policy date

Checkbox on treeview

Hi,
I have a treeView and I use the checkbox functionality. I have isChecked="IsChecked" in the treeView and the checkboxes show but I want them to be disabled, meaning you cannot check and uncheck them but still show based on the property. Can you, please tell me how to achieve that.
Thank you!
Elena

2 Replies

CI Christopher Issac Sunder K Syncfusion Team March 14, 2019 04:05 AM

Hi Elena, 

Thank you for contacting Syncfusion support. 

You can disable the checkbox element alone instead of disabling the whole node. You need to include the class e-checkbox-disabled into the checkbox element using the drawNode event, 

function drawNode(args) { 
    let ele: HTMLElement = args.node.querySelector('.e-checkbox-wrapper'); 
    ele.classList.add('e-checkbox-disabled'); 
} 

 
Note: In the above sample, we have disabled all the checkboxes. If you want to disable a checkbox in a particular node, you can get the node id (args.node.id) from the drawNode event and set your condition to skip the other nodes. 

Please let us know if you need further assistance on this. 

Thanks, 
Christo 



EP Elena Popova March 19, 2019 02:12 AM

Thank you for the support!
Best regards,
Elena

Loader.
Live Chat Icon For mobile
Up arrow icon