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