title: TreeView vertical scrollbar does not expand to the last node, last node is hidden?
body: <p>I am experiencing an odd behaviour from a TreeView control. </p>
  
  <p><img src="https://i.stack.imgur.com/W4SxG.png" alt="enter image description here"></p>
  
  <p>As you can see, the last node in the treeview is somehow hidden (although I can select it with keyboard up/down arrow keys) and the scroll bar does not expand to it. In the picture the blue line you see is the selected node that is hidden but luckily still a bit of highlight is visible!</p>
  
  <p>Even when I press pagedown or END keys, I cannot select the last node! </p>
  
  <p>I tried to change height of the treeview control to match the height of nodes but still no success! My treeview is inside a 'panel'. could it be the problem?   </p>
  
  <p><strong>UPDATE</strong>
  I am not doing something extraordinary. I just populate with a loop over a List&lt;> (using suspend and resume before and after loop) then the treeview will be populated normally.</p>
  
  <pre><code>public class MyNode
  {
  public string Name {get;set;}
  public string Result {get;set;} 
  }
  //suspending code here (dont have access to paste it here)
      foreach(MyNode node in myNodeList)
      {
      TreeNode tn = new TreeNode();
      tn.Text = node.Name;
      tn.Name = node.Result;
      treeView.Nodes.Add(tn);
      }
  ////unsuspending code here (dont have access to paste it here)
  </code></pre>
  
  <p>Later I allow user to press a button to highlight the nodes that have result set to 'fail':</p>
  
  <pre><code>foreach(TreeNode node in treeView.Nodes)
  {
  if (node.Name.ToString() == "fail") node.BackColor = Color.Red;
  }
  </code></pre>
  
  <p>After this, the last node in the treeview is going hidden!!!</p>
  
  <p><strong>FIX</strong>
  I used BeginUpdate() and EndUpdate() methods and the problem is gone!!!</p>