Click here to Skip to main content
11,802,076 members (51,331 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: SQL-CE C# SQL-Server Forms , +
How can I add the content of this clipboard to a datarow to be placed in the original datatable? The dataadapter and datatable declarations are not global.

if (this.dataGridView1.GetCellCount(DataGridViewElementStates.Selected) > 0)
        DataGridViewRow dgvr = new DataGridViewRow();

    catch (Exception ex)

This code gets the information of the selected row fine. How should I go about adding this to the bottom of the datagrid? The intent is to be able to edit the copied row to make a few changes to it. Should I add this to a new datatable and bind this with the original datatable to the datagrid?
Posted 30-Jan-13 5:57am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

This could be possible to do in a number of interesting ways.
The simplest would be to handle the the keydown event on the grid (capture Ctrl + V).

Here are some articles that might help you -[^][^]

Copy from grid to other applications - DataGridView Copy and Paste[^].

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 485
1 KrunalRohit 341
2 F-ES Sitecore 255
3 Afzaal Ahmad Zeeshan 220
4 CPallini 205
0 OriginalGriff 2,715
1 Maciej Los 1,900
2 KrunalRohit 1,797
3 CPallini 1,550
4 Richard MacCutchan 1,157

Advertise | Privacy | Mobile
Web03 | 2.8.151002.1 | Last Updated 30 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100