tags:

views:

98

answers:

1

Hello, Friends. I cant find the equivalent method of DataGridView.GetClipboardContent() on DataGrid VC++.Net Framework 1.1, in case of not exists how can I achive for the same functionality, I mean copy all the rows and headers on the clipboard object and then paste it on a Excel Sheet...

//code for send data to excel
dataGridView1.SelectAll();
DataObject dataObj = dataGridView1.GetClipboardContent();
Clipboard.SetDataObject(dataObj, true);
ws.Paste(System.Type.Missing, System.Type.Missing); // ws = worksheet
dataGridView1.ClearSelection();

Thanks

+1  A: 

Did you try this?

John at CashCommons