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

Multiple Select does not work when we set OnNodeClick

5 Answers 129 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Marut
Top achievements
Rank 1
Marut asked on 04 Aug 2014, 08:21 AM
Hi all, 


I have a problem with mulipleselect setting. 

Without OnNodeClick setting . it works fine. I can do shift and select the nodes. 


Is there any workaround for this to get both of them to work together at all?


Thank you in advance 

Cheers.

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 04 Aug 2014, 08:47 AM
Hi Marut,

This is the expected behavior of the control. The RadTreeView NodeClick  will not fire when the  MultipleSelect property is  set to True. If the RadTreeView fires the NodeClick server event on every node click , then the user will not be able to select multiple nodes at once, because after the first click the page will postback. In this case you can use the client-side events of RadTreeView OnClientNodeClicking and OnClientNodeClicked

Thanks,
Princy.
0
Marut
Top achievements
Rank 1
answered on 05 Aug 2014, 02:45 AM
Hi Princy , 


Sorry to misunderstood you. The problem i have is about Multiple selection . When I click fist node (let's say it's the node at the very top ) then NodeClick does its job. Now I press SHIFT button then select the node at the bottom . 

It's doesn't select the whole lots for me. 


Without NodeClick it works as expected. 



Thank you Princy 

Cheers.
0
Princy
Top achievements
Rank 2
answered on 27 Aug 2014, 12:31 PM
Hi Marut,

Unfortunately I couldn't replicate the issue at my end. Please have a look into the sample code snippet which works fine at my end.

ASPX:
<telerik:RadTreeView ID="RadTreeView1" runat="server" MultipleSelect="true" OnClientNodeClicked="click">
    <Nodes>
        <telerik:RadTreeNode Text="Node1">
        </telerik:RadTreeNode>
        <telerik:RadTreeNode Text="Node2">
        </telerik:RadTreeNode>
        <telerik:RadTreeNode Text="Node3">
        </telerik:RadTreeNode>
        <telerik:RadTreeNode Text="Node4">
        </telerik:RadTreeNode>
        <telerik:RadTreeNode Text="Node5">
        </telerik:RadTreeNode>
    </Nodes>
</telerik:RadTreeView>

JavaScript:
function click(sender, args) {
    alert("fired");
}

Thanks,
Princy.
0
Bob
Top achievements
Rank 1
answered on 03 Jun 2016, 05:30 PM

Hi Princy,

Within Chrome on a desktop it is a little different when MultipleSelect=true.  If a user clicks on a node, it triggers the OnNodeClick event.  However, if a user holds down the Ctrl key and clicks one or more additional nodes, the OnNodeClick is not triggered.

On the iPad using Chrome where isMobileSafari is true and MultipleSelect=true, RadTreeView is behaving as you stated.

Can you confirm this is correct and why there are differences in behavior because it seems Chrome on the iPad could match Chrome on the desktop behavior in this situation?

Thank You...Bob Baldwin
Trabon Solutions

0
Peter Milchev
Telerik team
answered on 08 Jun 2016, 08:48 AM
Hello,

As stated in the documentation article on Mutually Exclusive Scenarios for enabled MultipleSelect and OnNodeClick server event, while holding the Ctrl or Shift keys and selecting nodes the NodeClick server event does not fire. This is by design, otherwise it would fire after the first click on the first node and the user will not be able to select another node. The client-side events OnClientNodeClicking and OnClientNodeClicked do fire for every clicked node.

As for the problem Marut encountered it does not appear with the latest version of the RadTreeView control.

Peter Milchev
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
TreeView
Asked by
Marut
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Marut
Top achievements
Rank 1
Bob
Top achievements
Rank 1
Peter Milchev
Telerik team
Share this question
or