Multiple selected items

2 posts, 1 answers
  1. Aykut
    Aykut avatar
    25 posts
    Member since:
    Feb 2009

    Posted 15 Oct 2009 Link to this post

    Hi,
    Is it possible to have one selected subitem under each item?
    thanks.
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 16 Oct 2009 Link to this post

    Hi Aykut,

    I guess you want to select only single item under each item and want to select multiple nodes those have different parent nodes. If so attach OnClientNodeClicking event and try the client side code shown below.

    JavaScript:
     
    <script type="text/javascript"
        function OnClientNodeClicking(sender, args) { 
            var parent = args.get_node().get_parent(); 
            if (parent != null && !args.get_node().get_selected()) { 
                var number = parent.get_nodes().get_count(); 
                for (var i = 0; i < number; i++) { 
                    if (parent.get_nodes().getNode(i).get_selected()) { 
                        args.set_cancel(true); 
                    } 
                } 
            } 
        } 
    </script> 

    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top