Rad dropdowntree onclick event

9 posts, 1 answers
  1. Prabha
    Prabha avatar
    26 posts
    Member since:
    Dec 2013

    Posted 06 Jun 2014 Link to this post

    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. 
  2. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 06 Jun 2014 in reply to Prabha Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 06 Jun 2014 Link to this post

    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.

     
  5. Prabha
    Prabha avatar
    26 posts
    Member since:
    Dec 2013

    Posted 06 Jun 2014 Link to this post

    Hai Princy,
       OnClientEntryAdding   has been working fine. Thank you for your immediate reply.
  6. Sam
    Sam avatar
    50 posts
    Member since:
    Apr 2008

    Posted 11 Mar 2015 in reply to Prabha Link to this post

    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.


  7. Sam
    Sam avatar
    50 posts
    Member since:
    Apr 2008

    Posted 11 Mar 2015 in reply to Sam Link to this post

    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
  8. Robert Wang
    Robert Wang avatar
    1 posts
    Member since:
    Oct 2003

    Posted 04 Mar in reply to Nencho Link to this post

    Is it possible that you can give an example of VB in this case?  Thanks.
  9. Matthias
    Matthias avatar
    3 posts
    Member since:
    Oct 2013

    Posted 22 Nov Link to this post

    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!


  10. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 24 Nov Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017