Multiple Select does not work when we set OnNodeClick

6 posts, 0 answers
  1. Marut
    Marut avatar
    15 posts
    Member since:
    Dec 2007

    Posted 04 Aug 2014 Link to this post

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

    Posted 04 Aug 2014 in reply to Marut Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Marut
    Marut avatar
    15 posts
    Member since:
    Dec 2007

    Posted 04 Aug 2014 in reply to Princy Link to this post

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

    Posted 27 Aug 2014 in reply to Marut Link to this post

    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.
  6. Bob
    Bob avatar
    46 posts
    Member since:
    Apr 2012

    Posted 03 Jun in reply to Princy Link to this post

    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

  7. Peter Milchev
    Admin
    Peter Milchev avatar
    135 posts

    Posted 08 Jun Link to this post

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