This is a migrated thread and some comments may be shown as answers.

Check/Uncheck checkboxes with click on node

2 Answers 101 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Henrique Duarte
Top achievements
Rank 1
Veteran
Henrique Duarte asked on 05 Jun 2008, 10:10 PM
How can I check or uncheck the checkbox from node when user click on node?

[]'s,

Henrique

2 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 06 Jun 2008, 06:20 AM
Hello Henrique Duarte,

You can use the client-side API to achieve this task. Subscribe to the OnClientNodeClicked event and use the check() method of the tree node:

function onClientNodeClicked(sender, args)
{
  args.get_node().check();
}

You can find all JavaScript methods of the RadTreeNode client-side object here.

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Sergey
Top achievements
Rank 1
answered on 24 Jul 2008, 09:18 AM
function onClientNodeClicked(sender, args)  
{  
  args.get_node().check();  

that didn't work for me well. It's only trying to check on node if it was unchecked

This function work perfect for me:

function onClientNodeClicked(sender, args)  
{  
  args.get_node().set_checked(  !args.get_node().get_checked()  );  
}  
 
Tags
TreeView
Asked by
Henrique Duarte
Top achievements
Rank 1
Veteran
Answers by
Atanas Korchev
Telerik team
Sergey
Top achievements
Rank 1
Share this question
or