开发者

Number of columns in a DataGridView

开发者 https://www.devze.com 2023-04-01 20:29 出处:网络
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.Co

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, Intel开发者_JAVA技巧lisense does not suggest it. I had to manually enter it. Strange.


Are you looking for ColumnCount?

0

精彩评论

暂无评论...
验证码 换一张
取 消