RadTreeview Disable checkboxes but enable expanding

3 posts, 0 answers
  1. Chris
    Chris avatar
    4 posts
    Member since:
    Oct 2011

    Posted 09 Oct 2013 Link to this post

    Hi ,

    I want the treeview checkboxes to be disabled (Not Hidden) while the treeview is still expandable and collapsible.. Is there a way to accomplish this?

    Thanks
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 10 Oct 2013 Link to this post

    Hi Chris,

    I suppose you are trying to disable the checkboxes of  corresponding nodes while expanding/collapsing. Please try the following JavaScript.

    JavaScript:
    <script type="text/javascript">
        function OnClientNodeExpanding(sender, args) {
            var currentNode = args.get_node();
            currentNode.get_checkBoxElement().disabled = true;
            var allNodes = currentNode.get_allNodes();
            var allNodesCount = allNodes.length;
            for (var i = 0; i < allNodesCount; i++) {
                allNodes[i].get_checkBoxElement().disabled = true;
            }
        }
    </script>
    You can do the same in OnClientNodeCollapsing event.

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Chris
    Chris avatar
    4 posts
    Member since:
    Oct 2011

    Posted 10 Oct 2013 Link to this post

    Thank you.. That looks like the code I need, but not getting it to work, Is it maybe because I am using a tri-state TreeView?
Back to Top