0
複製使用VB.Net如何在最後一排的DataGrid
我想最後一排的值複製到新行
代碼
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代碼幫助