Мой DataGridView не работает хорошо. Это мой код, я только хочу отобразить 4 столбца, причем первый столбец является столбцом флажка.
Dim dt_zone As DataTable
Dim iCounter As Integer
dt_zone = obj_aims_zone.get_row_for_display("", area_id)
dvg_selected_group_list.DataSource = Nothing
If dt_zone IsNot Nothing Then
If dt_zone.Rows.Count > 0 Then
dvg_selected_group_list.DataSource = dt_zone
For Each row As DataGridViewRow In dvg_selected_group_list.Rows
If row.Cells(3).Value.ToString.Equals(group_id) Then
row.Cells(check.Index).Value = True
End If
row.Cells(1).ReadOnly = True
row.Cells(2).ReadOnly = True
row.Cells(3).ReadOnly = True
row.Cells(4).ReadOnly = True
Next
For iCounter = 1 To 7
dvg_selected_group_list.Columns.RemoveAt(5)
Next
End If
End If