这是我的代码,它在dgv2Cb
.
谁能告诉我哪里出错了?
Dim dgv2Cb As New DataGridViewComboBoxCell
Dim str1 = "Port"
Dim rowIndex = 0
If str1 = "Port" Then
dgv2Cb.Items.Add("1")
dgv2Cb.Items.Add("2")
dgv2.Rows.Add(str1)
dgv2.Rows(rowIndex).Cells(1) = dgv2Cb 'Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index
End If