OnNodeClick conflicts with client-side "Double click expand"

7 posts, 1 answers
  1. Martin
    Martin avatar
    27 posts
    Member since:
    May 2011

    Posted 06 Nov 2012 Link to this post

    Hi there,

    I´m new to both ASP.Net and the controls from Telerik. I´m creating a web application which mainly consists of a RadSplitter with a RadPane (navigation) to the left and a RadPane (content) to the right. I have pre-populated the entire tree (since I want performance and no load-on-demand since we max are dealing with 100 nodes). Everything works smoothly but one thing:

    When I´m using the event "OnNodeClick", the "content"-panel to the right should load a bunch of data and populate controls on the right panel. So each click on a node should load content to the pane to the right. I also want to be able to double click on a node to both expand the node and also load the content to the right pane. This does not work since two "OnNodeClick"´s are generated and the expand does not work. 

    How do I solve this?

    Thanks
  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 08 Nov 2012 Link to this post

    Hello Martin,

    I am afraid that this behavior can not be achieved because single click event is always fired and this make it impossible for the DoubleClick to be handled.

    Here is an article in our help resources, which explains in more details( see Point 3).

    Hope this will be helpful.

    Regards,
    Boyan Dimitrov
    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Martin
    Martin avatar
    27 posts
    Member since:
    May 2011

    Posted 09 Nov 2012 Link to this post

    Hello and thank you for your answer. This sounds ridicolous.

    So what you´re saying is that with your treeview, its not possible to have data loaded on MouseClick and also have the possiblity of expanding the node? It sounds like one of the most important things that should work (like Windows Explorer). Whats the reason of having the ClickEvent firing then double clicking? 

    Is there not way around this? Is it a limitation with Telerik RadTreeview or do you know any other treeview that can handle this?

    Which is the preferred way of navigating through treeviews and loading data then?

    Just saw that it seems to work on your Outlook Webmail sample page...Why does it work there? When double-clicking Inbox it expands the subfolders and also loads the grid to the right...

    Thanks
  5. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 14 Nov 2012 Link to this post

    Hello Martin,

    I am afraid that there was a little misunderstanding in out communication-please excuse me for that. Our integrated web mail demo shows both expand/collapse and NodeClick functionality since there is an AjaxManager on the page that prevents the Page from post back and just updates the RadGrid control using callback.
    I would like to recommend you to review our online demo that implements expand/collapse functionality on double click and OnClientClicked client-side event to show additional information on the right for the clicked node.

    I would like to apologize for any inconveniences caused.

    Hope that this will lead you into right direction.

    Kind Regards,
    Boyan Dimitrov
    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.
  6. Martin
    Martin avatar
    27 posts
    Member since:
    May 2011

    Posted 26 Nov 2012 Link to this post

    Ok, 

    When I remove the ajaxmanager.ajaxequest, double click expand works as expected. It also populates the child nodes as expected. But as soon as I wire the ajaxrequest, the double click expand does not work anymore. In the code behind method I only have "return;" so no other loading is performed. The entire page (except for the scripts) are in an ajaxmanager.

  7. Answer
    Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 29 Nov 2012 Link to this post

    Hello Martin,

    Please find attached a sample project that implements a very similar to the described scenario. Please keep in mind that the ajaxmanager.ajaxrequest client-side method requires setting the AjaxManager to update the specified control used in your AjaxRequest event handler.

    //markup
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadTextBox1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>

    //code behind
    protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
        {
            RadTextBox1.Text = e.Argument;
        }

    The attached project works as follows:
    1. In the OnClientNodeClick event, the AjaxManager makes an AjaxRequest and updates the RadTextBox in the right pane with the clicked node value.
    2. Double click on each node performs expand/collapse of the child nodes.
    Hope that you will find it helpful.

    Regards,
    Boyan Dimitrov
    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.
  8. Martin
    Martin avatar
    27 posts
    Member since:
    May 2011

    Posted 29 Nov 2012 Link to this post

    Hi, everything worked when switching the Ajaxpanel to a Ajaxradmanager instead...Thanks
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017