private void btnSelectAll_Click(object sender, EventArgs e) { foreach (var node in companyTreeView.Nodes) { ((TreeNode)node).Checked = true; } }