title: Number of columns in a DataGridView
body: <p>I must be missing something <em>very</em> obvious, since even searching for a couple of minutes returned nothing, but how can I get the number of columns in a <code>DatagridView</code>? The obvious <code>DataGridView1.Columns.Count</code> is wrong.</p>
  
  <p>I am sorry if this has been asked a million times or has an obvious answer, but I just can't find it.</p>
  
  <p><strong>Edit:</strong> I just found at <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcolumncollection.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcolumncollection.aspx</a> that the <code>DataGridViewColumnCollection</code> does have a property <code>Count</code>, so I used it and it worked. However, Intellisense does not suggest it. I had to manually enter it. Strange.</p>