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

RadTreeview Disable checkboxes but enable expanding

2 Answers 56 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 09 Oct 2013, 10:17 AM
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 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 10 Oct 2013, 07:12 AM
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.
0
Chris
Top achievements
Rank 1
answered on 10 Oct 2013, 09:44 AM
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?
Tags
TreeView
Asked by
Chris
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Chris
Top achievements
Rank 1
Share this question
or