RadTreeView OnNodeClick vs Double Click

4 posts, 0 answers
  1. Jerry
    Jerry avatar
    10 posts
    Member since:
    Aug 2011

    Posted 11 Aug 2011 Link to this post

    I have a ASP.Net app with a user control that contains the RadTreeView control. Currently the RadTreeView control does not have any double click event define. However, double clicking a node in the tree does collapse or expand it's child nodes. I assume this is the default behavior for the RadTreeView. This is the desired behavior we want.

    I want to add an OnNodeClick event to this tree so a user can select a node and fire an event.

    However, some pages that consume this user control don't want the OnNodeClick event. Instead they want to be able to just select/highlight a node. These are the same pages that want the Double click to expand and collapse the nodes.

    When I add the OnNodeClick event to the RadTreeView user control, the pages that want the OnNodeClick event work as desired.

    But the original pages that don't want the OnNodeClick event work OK except that the Double Click no longer collapses or expands the nodes. When double clicked, the node collapses then expands immediately.

    How can I turn the OnNodeClick event off on some pages and on for other pages?

    Or, can I programmatically  define the OnNodeClick event dynamically on the pages that needs it?

  2. Plamen
    Plamen avatar
    2812 posts

    Posted 17 Aug 2011 Link to this post

    Hi Jerry,

    You can try to add the handler in the Page_Load event like in the code bellow:

    protected void Page_Load(object sender, EventArgs e)
           if (true)
               RadTreeView1.NodeClick += new RadTreeViewEventHandler(RadTreeView1_NodeClick);
       void RadTreeView1_NodeClick(object sender, RadTreeNodeEventArgs e)
           throw new NotImplementedException();

    Hope this helps.

    All the best,
    Plamen Zdravkov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. Neelim
    Neelim avatar
    1 posts
    Member since:
    Feb 2013

    Posted 19 Feb 2013 Link to this post


    I have tried all these techniques. But for my scenario, when I double click - need to open 'Edit page' relevant to each node . Basically the node items has 'Menu Page' menu  ( included- Edit,Delete,Clone)  which will appear when I right click on the node! 

    In more detail - On my server side I can able to call this Menu page using a event handler. But how can I call that event handler from client side. Because we only have client side double click event for radtreeview control ! 

    Hope it is clear !
    Anyone can help me please?
  4. Plamen
    Plamen avatar
    2812 posts

    Posted 22 Feb 2013 Link to this post

    Hi Neelim,

    In RadTreeView you have also onClientClicking event and you can use it to perform and AjaxRequest for example.

    Hope this will be helpful.

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top