DataGridView相关的复制和粘贴
比如说我在DataGridView中有一条记录,我想复制这条记录,然后粘贴,把里面显示的记录变成2条,就跟Excel里面复制一条记录然后再粘贴一样,最好可以和Excel里面一样可以用键盘的快捷键Ctrl+C和Ctrl+V来操作,只需要有复制和粘贴功能,我是这方面的菜鸟,希望各位大侠可以帮忙解决这个问题,使用VB.Net,谢谢
[解决办法]
Dim r As New DataGridViewRow
r = DataGridView1.Rows(i).Clone
r.Cells(0).Value = DataGridView1.Rows(i).Cells(0).Value
r.Cells(1).Value = DataGridView1.Rows(i).Cells(1).Value
……
DataGridView1.Rows.InsertRange(2, r)
看看DataGridView1.Rows.里面的方法。