11 Answers, 1 is accepted
Please check the following live demo: Validation, which shows how to validate RadDropDownTree by the use of an asp:CustomValidator. In this case the page could be submitted only if something, that will change the default value of the control, is chosen from the RadDropDownTree. The validatePage() function attached to the ClientValidationFunction validator event checks the count of the entries collection of the DropDownTree and if it is 0, sets the args.IsValid to false.
The DropDownTree also works with all of the standard ASP.NET validators.
For all checked nodes are created entries, which you can access in the Entries server collection of the control and get the needed information. Please also check and use the following server events.
Thank you for your reply. My design is quite different.
For each RadDropDownTree entries, I enable the checkbox.
When I click Submit button, I want to see which entry has been checked.
Is this possible to do using RadDropDownTree?
You can obtain the entries client side by getting reference to the DropDownTree client-side object
var ddt = $find("ctl00_ContentPlaceholder1_RadDropDownTree1");
and get_entries() method, which returns the RadDropDownTree Entries collection:
Please see the attached image for more information.
Thank you for the quick reply.
Since the design involved postback, is there a way to check on the server side instead of client side?
Check this article: Accessing the Embedded Tree - by having a reference to the treeview control you can use its server API to see which nodes are selected >
I tested like this, not on Page_Load, but upon button click:
For Each tree As RadTreeNode In RadDropDownTree1.EmbeddedTree.Nodes
MsgBox(tree.Text + " " + tree.Checked.ToString())
It did not capture the checked/unchecked state of the RadDropDownTree1
My advice is to make it working for a Button Click and after that in the page events: