【发布时间】:2018-09-09 11:39:02
【问题描述】:
在我使用$DataGridView1.Rows[$row.Index].Visible = $false 隐藏了一些行之后,我需要计算现在可见的行数。
如果我使用$DataGridView1.Rows.GetRowCount.ToString()
我得到这个结果:
int GetRowCount(System.Windows.Forms.DataGridViewElementStates includeFilter)
所以,如果我使用$DataGridView1.Rows.GetRowCount($DataGridViewElementStates.Visible)
我希望 DataGridView 中有许多可见行,但它返回异常:
Cannot convert argument "includeFilter", with value: "", for "GetRowCount"
to type "System.Windows.Forms.DataGridViewElementStates": "Cannot convert null
to type "System.Windows.Forms.DataGridViewElementStates" due to enumeration
values that are not valid. Specify one of the following enumeration values and
try again. The possible enumeration values are
"None,Displayed,Frozen,ReadOnly,Resizable,ResizableSet,Selected,Visible"."
我做错了什么?
【问题讨论】:
标签: powershell datagridview visible rowcount