我正在尝试根据我在 DataGridView 上选择的单元格获取行索引。我怎样才能在 VB.NET 中做到这一点?
这就是我所拥有的:
Dim iRowIndex As Integer
For i = 0 To Me.grdTransaction.SelectedCells.Item(iRowIndex)
iRowIndex = Me.grdTransaction.SelectedCells.Item(i).RowIndex.ToString()
Dim s As String = Me.grdTransaction.SelectedRows(i).Cells("DataGridViewTextBoxColumn6").Value
aList.Add(s)
MsgBox("Row index " & iRowIndex)
Next