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

Rad dropdowntree onclick event

8 Answers 443 Views
DropDownTree
This is a migrated thread and some comments may be shown as answers.
Prabha
Top achievements
Rank 1
Prabha asked on 06 Jun 2014, 06:19 AM
hai all,

     how do i call onclick or onnodeclick event in dropdowntree.?  bz there is no click event available in this control. i have to load some other control based on dropdowntree clicked node. 

8 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 06 Jun 2014, 07:33 AM
Hi Prabha,

RadDropDownTree have two events called OnClientEntryAdding  and OnClientEntryAdded. Both will fire when an entry is about to be added to the Entry area.  The OnClientEntryAdding  event can be cancelled and the OnClientEntryAdded event cannot be cancelled. In your Scenario you can use any of the event.

Let me know if you have any concern. 
Thanks,
Princy.
0
Nencho
Telerik team
answered on 06 Jun 2014, 10:44 AM
Hello Prabha,

Since the RadDropDownTree contains the RadTreeView control embedded in it, you could handle its NodeClick event handlers - both client and server side. Please consider the following implementation :


protected void Page_Load(object sender, EventArgs e)
   {
       RadDropDownTree1.EmbeddedTree.NodeClick += EmbeddedTree_NodeClick;
   }
 
   void EmbeddedTree_NodeClick(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
   {
       //implement logic here
   }


Regards,
Nencho
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Prabha
Top achievements
Rank 1
answered on 06 Jun 2014, 11:06 AM
Hai Princy,
   OnClientEntryAdding   has been working fine. Thank you for your immediate reply.
0
Sam
Top achievements
Rank 1
answered on 11 Mar 2015, 06:29 PM
Could you please provide this mechanism of subscribing to
the event on the server side in VB. When I used the code convertor and used the
output, I had an error for each side of the equal sign, so there is something
still missing to make it work. Thank you.


0
Sam
Top achievements
Rank 1
answered on 11 Mar 2015, 07:16 PM
I found the code for VB in case anyone needs it - and it did not work in the Page_Load, it had to be in the dropdownTree Load event:

AddHandler SegmentsDownTree.EmbeddedTree.NodeExpand, AddressOf NodeExpand
0
Robert Wang
Top achievements
Rank 1
answered on 04 Mar 2016, 04:23 PM
Is it possible that you can give an example of VB in this case?  Thanks.
0
Matthias
Top achievements
Rank 1
answered on 22 Nov 2016, 10:09 AM

Hi Nencho,

could you please provide an example how to handle the NodeClick Event of the RadTreeView control on client side for a RadDropDownTree?

I can handle the OnClientEntryAdded-Event, when a Checkbox is checked, but not, if it is unchecked.

 

<telerik:RadDropDownTree RenderMode="Classic" ID="ddt" runat="server"
   CheckBoxes="SingleCheck" AutoPostBack="false"  OnClientEntryAdded="clientNodeChecked"
</telerik:RadDropDownTree>

 

Thanks for your help!


0
Nencho
Telerik team
answered on 24 Nov 2016, 08:49 AM
Hello Matthias,

The approach that we recommend in such scenarios is to use the client-side events of the embedded TrewView. In other words, in the code behind you can subscribe for the OnClientNodeChecked and handle the function in the markup:
//code-behind
protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        ddt.EmbeddedTree.OnClientNodeChecked = "OnClientNodeChecked";
    }
}
//markup
<script type="text/javascript">
    function OnClientNodeChecked(sender, args) {
    }
</script>

Hope this would help.

Regards,
Nencho
Telerik by Progress
Telerik UI for ASP.NET AJAX is ready for Visual Studio 2017 RC! Learn more.
Tags
DropDownTree
Asked by
Prabha
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Nencho
Telerik team
Prabha
Top achievements
Rank 1
Sam
Top achievements
Rank 1
Robert Wang
Top achievements
Rank 1
Matthias
Top achievements
Rank 1
Share this question
or