title: How to make parent node can not selected in treeview?
body: <p>How to make parent node  can not selected in treeview ?</p>
  
  <p>If the node is "Parent" , it can not support select,
  so I add code </p>
  
  <pre><code> if (drv["isParent"].ToBool())
          {
              node.Selected = false;
          }
  </code></pre>
  
  <p>But not work? how to fix ?</p>
  
  <pre><code>        TreeNode node;
          var rows = dv.AsEnumerable().Where(r =&gt; r["ParentID"].ToString() == parentid);
  
          foreach (DataRow drv in rows.AsEnumerable())
          {
              //  DataRowView一行
              node = new TreeNode();
              node.Value = drv["NodeID"].ToString();
              node.Text = drv["Name"].ToString();
              if (drv["isParent"].ToBool())
              {
                  node.Selected = false;
              }
  
              tnc.Add(node);
  
              if (drv["ObjectCode"].ToString() != "0")
              {
                  InitTree(node.ChildNodes, node.Value);
              }
          }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/InmFj.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/InmFj.jpg" alt="enter image description here"></a></p>