views:

13

answers:

1

Hey Friends,
My winform application is having a DataGridView (DGV), I'm populating it from an xml file by using ReadXml() and displaying the contents into DGV:

<deptt>
<proj1>
<Rel_Date>23 Jun 2010</Rel_Date>
<Rev>0</Rev>
<Doc>Some name of document</Doc>
</proj1>
</deptt>

I've got a prob here.... How can I copy 3 cells from xls file and add(paste) them into this DGV???? Let's say my xls is having same information as that in xml.
         Col1                  Col2      Col3
Row1 23 Jun2010         1         Document name

+1  A: 

Assuming that you want Ctrl+C, Ctrl+V type of functionality; you can register KeyDown and KeyUp events; and try fetching the data from Clipboard.

This might help.

KMan
Thx for da answer, this was really helpfull. There are few issues like 1. After pasting da content, every mouse click is adding a new row in da DGV. 2. If Date is not as per xml's format then da DGV's cell validating check complains. I'll try to sort them too. Thx anyways for da answer.
gsvirdi