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

How to disable node select on mouse right click

I want to disable node click event  for mouse right click.

node click and select node should only work for mouse left click and not on mouse right click.

Regards,
Sonam Diwate

1 Reply

CI Christopher Issac Sunder K Syncfusion Team April 1, 2019 10:37 AM UTC

Hi Sonam Diwate, 

Greetings from Syncfusion!!! 

You can check whether you right click the node by using following code snippet in the nodeSelecting event of treeview and cancel the event if it is right click. 

if (event.which === 3 && event.button === 2) { 
    args.cancel = true; 
} else { 
    alert("Node Selected"); 
} 


Please check the above sample and get back to us if you need any further assistance 

Thanks,
Christo 


Loader.
Live Chat Icon For mobile
Up arrow icon