I must be missing something very obvious, since even searching for a couple of minutes returned nothing, but how can I get the number of columns in a DatagridView? The obvious DataGridView1.Columns.Count is wrong.
I am sorry if this has been asked a million times or has an obvious answer, but I just can't find it.
Edit: I just found at http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridviewcolumncollection.aspx that the DataGridViewColumnCollection does have a property Count, so I used it and it worked. However, Intellisense does not suggest it. I had to manually enter it. Strange.
Are you looking for ColumnCount?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With