title: how to recursively build treeview in c#
body: <pre><code>private void enumerateValues(IEnumerator&lt;KeyValuePair&lt;string, object&gt;&gt; iEnumerator, TreeNode parentnode)
  {
     if(iEnumerator is IEnumerable)
     {
       // ADD THE KEY
       TreeNode childNode = parentnode.Nodes.Add(iEnumerator.Current.Key);
  
       enumerateValues(iEnumerator.Current.Value, childNode);
     }
    else
     {
       /// add the value
       TreeNode childNode = parentnode.Nodes.Add(iEnumerator.Current.Value.ToString());
     }
  }
  </code></pre>
  
  <p>I somehow get the following error:</p>
  
  <blockquote>
    <p>The best overloaded method match for 'WindowsFormsApplication1.Form1.enumerateValues(System.Collections.Generic.IEnumerator&lt;System.Collections.Generic.KeyValuePair&lt;string,object&gt;&gt;,
     System.Windows.Forms.TreeNode)' has some invalid arguments<br>
    Argument '1': cannot convert from 'object' to 'System.Collections.Generic.IEnumerator&lt;System.Collections.Generic.KeyValuePair&lt;string,object&gt;&gt;'</p>
  </blockquote>
  
  <p>How can i fix it please</p>