11 Answers, 1 is accepted
0
Hi Marc,
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.
Regards,
Rumen
Progress Telerik
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.
Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0

konnyaku
Top achievements
Rank 1
answered on 12 Apr 2019, 04:49 AM
Unrelated, but its regarding the sample given. When I postback the form. how do I get which nodes is checked from the server side?
0
Hi Konnyaku,
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.
Best regards,
Rumen
Progress Telerik
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.
Best regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0

konnyaku
Top achievements
Rank 1
answered on 10 May 2019, 06:48 AM
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?
0
Hello Konnyaku,
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:
ddt.get_entries()._array[0].get_text();
ddt.get_entries()._array[0].get_value();
Please see the attached image for more information.
Regards,
Rumen
Progress Telerik
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:
ddt.get_entries()._array[0].get_text();
ddt.get_entries()._array[0].get_value();
Please see the attached image for more information.
Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0

konnyaku
Top achievements
Rank 1
answered on 13 May 2019, 08:15 AM
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?
0
Hi,
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 >
Regards,
Rumen
Progress Telerik
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 >
RadDropDownTree1.EmbeddedTree.Nodes[0].Checked
Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0

konnyaku
Top achievements
Rank 1
answered on 23 May 2019, 08:43 AM
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())
Next
It did not capture the checked/unchecked state of the RadDropDownTree1
0
Hello,
My advice is to make it working for a Button Click and after that in the page events:
ASPX
Codebehind:
Regards,
Rumen
Progress Telerik
My advice is to make it working for a Button Click and after that in the page events:
ASPX
<
telerik:RadDropDownTree
RenderMode
=
"Lightweight"
ID
=
"RadDropDownTree1"
runat
=
"server"
Width
=
"300px"
CheckBoxes
=
"SingleCheck"
DefaultMessage
=
"Please select"
DataFieldID
=
"EmployeeID"
DataFieldParentID
=
"ReportsTo"
OnNodeDataBound
=
"RadDropDownTree1_NodeDataBound"
DataTextField
=
"LastName"
DataSourceID
=
"SqlDataSource1"
>
<
DropDownSettings
OpenDropDownOnLoad
=
"true"
/>
</
telerik:RadDropDownTree
>
<
asp:Button
Text
=
"ShowCheckedItems"
runat
=
"server"
OnClick
=
"Unnamed_Click"
/>
<
asp:TextBox
TextMode
=
"MultiLine"
Width
=
"200px"
Height
=
"200px"
runat
=
"server"
ID
=
"MultiBox1"
></
asp:TextBox
>
Codebehind:
Protected
Sub
Unnamed_Click(
ByVal
sender
As
Object
,
ByVal
e
As
EventArgs)
For
Each
node
As
RadTreeNode
In
RadDropDownTree1.EmbeddedTree.Nodes
If
node.GetAllNodes().Count <> 0
Then
For
Each
subnode
As
RadTreeNode
In
node.GetAllNodes()
checkedNode += subnode.Text &
" "
+ subnode.Checked.ToString() & vbLf
MultiBox1.Text = checkedNode
Next
End
If
Next
End
Sub
Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0

konnyaku
Top achievements
Rank 1
answered on 30 May 2019, 02:03 AM
Tried, but the subnode.Checked.ToString() value is never True.
0
On my side the solution works as expected. For your convenience I have attached my test files and a video demo.
Best Regards,
Rumen
Progress Telerik
Best Regards,
Rumen
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.