Private Sub BindDataGridView()
Dim count As Integer = 0
For count = 0 To EmployeeListBindingSource.Count - 1
Dim RowIndex As Integer = dataGrdView1.Rows.Add()
Dim row As DataRowView = DirectCast(EmployeeListBindingSource.Item(count), DataRowView)
dataGrdView1.Rows(RowIndex).Cells(0).Value = row.Item(1).ToString
dataGrdView1.Rows(RowIndex).Cells(2).Value = row.Item(0).ToString
Next
End Sub
行を次のように宣言します。
Dim row As DataRowView = DirectCast(EmployeeListBindingSource.Item(count), DataRowView)
次に、次のような列にアクセスします。
row.Item(1).ToString
と比較してください if CompareStr <> row.Item(1).ToString then
これが役立つことを願っています。