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

One checked child node per parent

2 Answers 66 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 1
Darren asked on 28 Aug 2008, 09:51 PM
I have a treeview that has Times as the parent nodes and Classes as the child nodes. I would like the customer to only be able to check 1 child node under each parent node. And I guess if they check a child node and another is already checked then I would like the other to be unchecked (maybe after a confirmation).

So, in the example below they could select Class1 and Class 11, but not Class 1 and Class 2.

Is this possible?

8AM
     Class 1
     Class 2
     Class 3
10AM
     Class 11
     Class 12
     Class 13
     Class 14
1PM
    Class 22
    Class 23

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 29 Aug 2008, 11:23 AM
Hi Darren,

I suggest you subscribe to the OnClientNodeChecking event and uncheck all nodes which have the same parent as the checked node. Please find attached a sample project demonstrating this approach. Download it and give it a try. 

Best wishes,
Yana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Darren
Top achievements
Rank 1
answered on 29 Aug 2008, 03:34 PM
This codes is great - thanks.
Tags
TreeView
Asked by
Darren
Top achievements
Rank 1
Answers by
Yana
Telerik team
Darren
Top achievements
Rank 1
Share this question
or