请尝试以下代码,看是否能满足你的需求。- Dim selectedRows As SelectedRowCollection = gcMultiRow1.SelectedRows
- Dim topSelectedRow As Integer = Int32.MaxValue
- For Each row As Row In selectedRows
- topSelectedRow = Math.Min(row.Index, topSelectedRow)
- Next
- If topSelectedRow < gcMultiRow1.RowCount Then
- gcMultiRow1.Rows.Insert(topSelectedRow, selectedRows.Count)
- End If
复制代码 |