Observer_123
asked on
Copy selected rows from unbound datagridview and reinsert them in the same datagridview - VB.Net (WinForms)
Hi!
I have one datagridview, which I fill with code cell by cell.
I want in runtime to create a copy of curently selected rows and reinsert this rows just before the current selection in the same datagridview with the same content.
In this datagridview have 2 columns which are dropdowns in 5 and 7 column.
What is the best way and some code for that?
I have one datagridview, which I fill with code cell by cell.
I want in runtime to create a copy of curently selected rows and reinsert this rows just before the current selection in the same datagridview with the same content.
In this datagridview have 2 columns which are dropdowns in 5 and 7 column.
What is the best way and some code for that?
Opps, this is for 4 columns ... just change it to the required ones.
ASKER
Hi!
The copy from clipboard is interesting, but it could be enought just duplication - we have selected rows , click a button and they are inserted. Is there some issue with dropdown copumns, or copy them as regular cells?
The copy from clipboard is interesting, but it could be enought just duplication - we have selected rows , click a button and they are inserted. Is there some issue with dropdown copumns, or copy them as regular cells?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
the last one looks mostly what I need, but in this case may it will be added at the end of datagridview.
any idea how to insert them just below the last selected row?
any idea how to insert them just below the last selected row?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanxs:)
You can do something like this (you may need to change something).
I have used the keydown event for CTRL+V combination
Open in new window