0
我使用下面的子程序使特定的行不可见,但是当我回到过滤的datagridview并尝试循环显示行索引时,它会从列顶部到列的底部而不是按顺序(1,2,3 ...等)。Datagridview行不可见,行选择随机
我已经能够将过滤器后的当前设置设置为顶部可见行,但这没有什么区别。
Private Sub BR_VAL_NO_SHOW()
Dim dgv As DataGridView = Me.dgvStockCheck_Available
Dim cm1 As CurrencyManager = CType(BindingContext(dgv.DataSource), CurrencyManager)
Try
For i As Integer = 0 To dgv.Rows.Count - 1
If IsDBNull(dgv.Rows(i).Cells("MATERIAL").Value) Then
Exit Try
Else
If Not dgv.Rows(i).Cells("MATERIAL").Value = "SLAT" Then
dgv.CurrentCell = Nothing
cm1.SuspendBinding()
dgv.Rows(i).Visible = False
End If
End If
Next
Catch ex As Exception
End Try
End Sub