title: How to change color in asp.net(c#) . if treenode checked
body: <p>In my ASP.NET application, used Treeview control with check box enabled.  In that treeview if i checked treenode want to show different color in specific checked node. see below </p>
  
  <pre><code> foreach (treenode node in treeview.nodes)
   {
      if (node.checked == true)
      {
        "change the color of the node" 
      }   
   }
  </code></pre>
  
  <p>i used to check the nodes like this below coding . but no tag to color change of checked nodes</p>
  
  <pre><code>    protected void TreeView1_TreeNodeCheckChanged(object sender, TreeNodeEventArgs e)
      {           
  
          if (e.Node.ChildNodes.Count &gt; 0)
          {
              CheckAllChildNodes(e.Node, e.Node.Checked);
          }
  
          if (e.Node.ChildNodes.Count == 0)
          {
              CheckAllParentNodes(e.Node);
          }
       }
  
       private void CheckAllChildNodes(System.Web.UI.WebControls.TreeNode treeNode, bool nodeChecked)
      {
          foreach (System.Web.UI.WebControls.TreeNode node in treeNode.ChildNodes)
          {
              node.Checked = nodeChecked;
  
              if (node.ChildNodes.Count &gt; 0)
              {
                  this.CheckAllChildNodes(node, nodeChecked);
              }
          }
      }
      private void CheckAllParentNodes(System.Web.UI.WebControls.TreeNode treeNode)
      {
          if (treeNode.Parent != null)
          {
              if (treeNode.Checked == false)
              {
                  treeNode.Parent.Checked = false;
                  CheckAllParentNodes(treeNode.Parent);
              }
          }
      }
  </code></pre>
  
  <p>Please help me to solve this thing ..  </p>