Checkbox single select

Hi,

Is there a way to prevent multi-selection of checkbox in a treeview?

Thanks.

2 Replies 1 reply marked as answer

CE Cedric E July 15, 2020 06:06 AM UTC

Hi,

Solved this by unchecking all nodes then passing the checked node to the component.

Ex. this.treeviewComponent.checkedNodes = [args.data[0].id];

However, is there a way to prevent the parent node from being selected? 

Thanks.


SP Sowmiya Padmanaban Syncfusion Team July 16, 2020 11:57 AM UTC

Hi Cedric , 
 
Greetings from Syncfusion support. 
 
We have checked your requirement with TreeView component. By disabling the autoCheck property, we can prevent auto checking of specified node’s parent checkbox or child nodes when checking on it. 
 
Refer the below code snippet. 
 
   
 <TreeViewComponent fields={this.fields} autoCheck ={false} showCheckBox={true}/> 
 
 
Refer the below sample link. 
 
 
Refer the below link to know more about the TreeView component. 
 
 
 
 
Please let us know, if you need any further assistance. 
 
Regards,  
Sowmiya.P 


Marked as answer
Loader.
Up arrow icon