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

Validating RadTree

1 Answer 38 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Marco
Top achievements
Rank 1
Marco asked on 28 Aug 2008, 07:17 AM
Hi, I want to validate the radTree, checking if the user has at least selected one node. How can I do that? I tried to create a custom control binding it to a server side validation function but I receive an error saying that the control cannot be validated.

Can you please help me?

Thanks,
Marco

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 29 Aug 2008, 11:35 AM
Hello Marco,

You can validate RadTreeView with javascript using get_selectedNode() method of the treeview client-side object like this:

var tree = $find("<%= RadTreeView1.ClientID %>");  
if (tree.get_selectedNode() == null)  
{  
  alert("Please select a node!");  

You should use get_selectedNodes method when MultipleSelect property is on.

Hope this helps.

Greetings,
Yana
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TreeView
Asked by
Marco
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or