使用 VB.Net
我想将最后一行值复制到新行
代码
Dim rcount As Int32
For i As Integer = 0 To gridview1.RowCount - 1
gridview1.Rows.Add()
rcount = gridview1.RowCount() - 1
For j As Integer = 0 To gridview1.Rows(i).Cells.Count - 1
gridview1.Rows(rcount).Cells(j).Value = gridview1.Rows(i).Cells(j).Value
Next
gridview1.Rows(rcount).Cells(1).Value = rcount + 1
rcount = 0
Next
上面的代码正在工作,但是它将所有前一行复制到新行,我想将最后一行复制到新行
如何解决这个问题呢。
需要 VB.Net 代码帮助