New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Expand Disabled Node

HOW-TO Have a disabled node which can be expanded and collapsed, but not clicked.

DESCRIPTION Disabled nodes cannot be selected, expanded and collapsed by design. Sometimes you might need a node which looks like disabled, cannot be selected, but still be expandable and collapsible.

SOLUTION To achieve the task we will leave the node enabled, but we will add an additional CSS class ("rtDisabled") to its parent element. This will give the node a "disabled" look. We will assign a category "Disabled" to the node so we can distinguish it from the others. To prevent selecting that node we will subscribe to the OnClientNodeClicking event and cancel the event if that node is clicked.

<telerik:RadTreeView RenderMode="Lightweight" ID="RadTreeView1" OnClientNodeClicking="OnClientNodeClickingHandler"
        <telerik:RadTreeNode runat="server" Text="Root RadTreeNode1" Category="Disabled">
                <telerik:RadTreeNode runat="server" Text="Child RadTreeNode 1">
                <telerik:RadTreeNode runat="server" Text="Child RadTreeNode 2">
function pageLoad() {
    var tree = $find("<%= RadTreeView1.ClientID %>");
    var nodes = tree.get_allNodes();

    for (var i = 0; i < nodes.length; i++) {
        var node = nodes[i];
        if (node.get_category() == "Disabled") {
            node.get_textElement().parentElement.className += " rtDisabled";

function OnClientNodeClickingHandler(sender, eventArgs) {
    var node = eventArgs.get_node();
    if (node.get_category() == "Disabled") {

Here is how you can add "disabled" nodes from the code-behind.

protected void Page_Load(object sender, EventArgs e) {     
        if (!IsPostBack)     
            RadTreeNode root = new RadTreeNode("root node");         
            root.CssClass += " rtDisabled";         
            root.Category = "Disabled";         
            RadTreeNode child = new RadTreeNode("child");        
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
    If Not IsPostBack Then
        Dim root As New RadTreeNode("root node")
        root.CssClass += " rtDisabled"
        root.Category = "Disabled"

        Dim child As New RadTreeNode("child")
    End If
End Sub
In this article