New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Inherit the the Checked State of the Parent Node In Load on Demand

Simply set the Checked property of the child Nodes to the Checked property of their parent Node, like this:

Server-Side Approach

This is pretty straightforward:

C#
protected void RadTreeView1_NodeExpand(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
{
    RadTreeNode firstChild = new RadTreeNode("new child1", "new1");
    firstChild.Checked = e.Node.Checked;
    RadTreeNode secondChild = new RadTreeNode("new child2", "new2");
    secondChild.Checked = e.Node.Checked;
    e.Node.Nodes.Add(firstChild);
    e.Node.Nodes.Add(secondChild);
}

Client-Side Approach

You need to first get the Checked state of the expanded Node in the OnClientNodePopulating event handler and store it for later usage.

This is required because after the Nodes are populated, by default, the CheckState (and Checked state) of their parent will be automatically updated (and its initial value will be lost) according to their Checked states.

Later, in the OnClientNodePopulated event handler set the Checked state of the child Nodes to the initial Checked state of their parent.

JavaScript
var expandedNodeChecked = null;

function onClientNodePopulated(sender, eventArgs) {
    if (expandedNodeChecked != null) {
        var parentNode = eventArgs.get_node();
        var childNodes = parentNode.get_nodes();
        var childNodeCount = childNodes.get_count();

        for (var nodeIndex = 0; nodeIndex < childNodeCount; nodeIndex++) {
            var childNode = childNodes.getNode(nodeIndex);

            childNode.set_checked(expandedNodeChecked);
        }
    }
}
function onClientNodePopulating(sender, eventArgs) {
    expandedNodeChecked = eventArgs.get_node().get_checked();
}
Not finding the help you need?
Contact Support