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

OnNodeClick conflicts with client-side "Double click expand"

7 Answers 136 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 06 Nov 2012, 04:24 PM
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

7 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 08 Nov 2012, 03:11 PM
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.
0
Martin
Top achievements
Rank 1
answered on 09 Nov 2012, 02:01 PM
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
0
Boyan Dimitrov
Telerik team
answered on 14 Nov 2012, 11:36 AM
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.
0
Martin
Top achievements
Rank 1
answered on 26 Nov 2012, 08:55 AM
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.

0
Accepted
Boyan Dimitrov
Telerik team
answered on 29 Nov 2012, 08:57 AM
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.
0
Martin
Top achievements
Rank 1
answered on 29 Nov 2012, 11:48 AM
Hi, everything worked when switching the Ajaxpanel to a Ajaxradmanager instead...Thanks
0
Arun
Top achievements
Rank 1
answered on 18 Aug 2017, 12:30 PM
Hi, When i doubleclick on node then it reload the whole page. How can i prevent the page being reload on doubleclick? Please help
Tags
TreeView
Asked by
Martin
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Martin
Top achievements
Rank 1
Arun
Top achievements
Rank 1
Share this question
or