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

Force specific level selection

2 Answers 41 Views
DropDownTree
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 12 Apr 2013, 02:25 PM
Hi Peter,

When validating a drop down list, is there a way to make it so that only data in the last level of a branch is selected?  ie in the example below only the bold text would count as a selected value and as such allow the control to validate to true.

1
1.1
1.1.1
1.1.2
1.2

1.3
1.3.1

Regards

Jon

2 Answers, 1 is accepted

Sort by
0
Peter Filipov
Telerik team
answered on 16 Apr 2013, 07:32 AM
Hello Jon,

Here are my suggestions:

1. Use single selection and handle the OnClientEntryAdding event and cancel the event when a particular node is selected.
2. Use single selection and and allow every of the nodes to be selected and use custom field validator to check selected value of the control.
3. Use the approach in the following demo and use checkboxes.

Regards,
Peter Filipov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Jon
Top achievements
Rank 1
answered on 16 Apr 2013, 10:20 AM
Hi Peter,

Yeah the single selection isn't really an option as sometimes I need the ability to check a large number of child nodes.

I think I'll use a custom validator and just parse the list to ensure that a node with no children has been checked/selected.

Best Regards

Jon
Tags
DropDownTree
Asked by
Jon
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
Jon
Top achievements
Rank 1
Share this question
or