title: TreeView Check/UnCheck all child items
body: <p>How do i check/uncheck all child items in TreeView?
  Probably error happened when one of items become to selected state and child items checked/unchecked buggy.</p>
  
  <p><strong><a href="http://www.sendspace.com/file/2nrt2a" rel="nofollow">Link to VS 2010 Project+Exe</a></strong></p>
  
  <p><strong><a href="http://www.youtube.com/watch?v=kviRgkpUiMs" rel="nofollow">Video on YOUTUBE</a></strong></p>
  
  <pre><code>private void Form1_Load(object sender, EventArgs e)
      {
          treeView1.CheckBoxes = true;
          treeView1.BeginUpdate();
          treeView1.Nodes.Add("1111");
          treeView1.Nodes[0].Nodes.Add("2222");
          treeView1.Nodes[0].Nodes.Add("2222");
          treeView1.Nodes[0].Nodes.Add("2222");
          treeView1.Nodes[0].Nodes.Add("2222");
          treeView1.Nodes[0].Nodes[1].Nodes.Add("3333");
          treeView1.Nodes[0].Nodes[1].Nodes[0].Nodes.Add("4444");
          treeView1.Nodes[0].Nodes[1].Nodes[0].Nodes.Add("4444");
          treeView1.Nodes[0].Nodes[1].Nodes[0].Nodes.Add("4444");
          treeView1.EndUpdate();
  
          treeView1.ExpandAll();
      }
  
      private void treeView1_AfterCheck(object sender, TreeViewEventArgs e)
      {
          treeView1.BeginUpdate();
  
          foreach (TreeNode Node in e.Node.Nodes)
          {
              Node.Checked = e.Node.Checked;
          }
  
          treeView1.EndUpdate();
      }
  </code></pre>