title: How to select a Node by Tag in Windows Forms TreeView
body: <p>I'm trying to select a node by tag. I've searched what I can, but still with no luck. I used this to assign a tag to each node in my <code>treeview</code></p>
  
  <pre><code> foreach (DataRow dataRow in databaseFunc.dataTable.Rows)
   {
        TreeNode nodes = new TreeNode();
        nodes.Text = dataRow["LastName"].ToString().Trim() + ", " +
              dataRow["FirstName"].ToString().Trim();
        nodes.Tag = dataRow[0].ToString().Trim();
        treeView.Nodes.Add(nodes);
   }
  </code></pre>
  
  <p>I know you can select a node using:</p>
  
  <pre><code> TreeNodeCollection nodeCollect = treeView.Nodes;
   treeView.SelectedNode = nodeCollect[index];
  </code></pre>