We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

copy/paste data to excel from gridGroupingControl

Syncfusion 4.4.

I need to design the functionality that copy and paste data (whole table or a range) from gcc to excel. It seems gridControl provides this functionality directly. But gcc doesn't.

Thanks for help in advance.

Wen

4 Replies

RA Rajagopal Syncfusion Team July 27, 2007 11:00 PM UTC

Hi Wen,

The GroupingGridExcelConverterControl class is used to convert the contents of GridGroupingControl to excel. Please make sure to include the XlsIO libraries in your project to have this support.

Syncfusion.GroupingGridExcelConverter.GroupingGridExcelConverterControl converter = new Syncfusion.GroupingGridExcelConverter.GroupingGridExcelConverterControl();
converter.GroupingGridToExcel(gridGroupingControl1,"Test.xls", Syncfusion.GridExcelConverter.ConverterOptions.Default);

Here is a sample for your reference
http://www.syncfusion.com/Support/user/uploads/ExcelExport_38d2e14c.zip

Let me know if this helps.
Thanks for using Syncfusion Products.

Regards,
Rajagopal


WE wen July 29, 2007 09:47 PM UTC

Hi Rajagopal,

Thank you for your reply. In fact I knew there is no problem to save content of gcc as an excel file. As the subject says, I want the functionality to copy and paste data from gcc to excel, instead of saving as a file.

Thanks a lot,
Wen



>Hi Wen,

The GroupingGridExcelConverterControl class is used to convert the contents of GridGroupingControl to excel. Please make sure to include the XlsIO libraries in your project to have this support.

Syncfusion.GroupingGridExcelConverter.GroupingGridExcelConverterControl converter = new Syncfusion.GroupingGridExcelConverter.GroupingGridExcelConverterControl();
converter.GroupingGridToExcel(gridGroupingControl1,"Test.xls", Syncfusion.GridExcelConverter.ConverterOptions.Default);

Here is a sample for your reference
http://www.syncfusion.com/Support/user/uploads/ExcelExport_38d2e14c.zip

Let me know if this helps.
Thanks for using Syncfusion Products.

Regards,
Rajagopal


RA Rajagopal Syncfusion Team July 30, 2007 08:28 PM UTC

Hi Wen,

The GridGroupingControl.TableModel.ClipboardCopy is the event that gets triggered when copy operation(Ctrl+C) is done. By default, doing ctrl+c will only copy the current cell to the clipboard. If you want to copy something else, say a range of cells/selected records, then in the grid.TableModel.ClipboardCopy event get the Table.SelectedRecords of the corresponding table and put them on the Clipboard.

Here is a small sample to show you how to copy the selected records/wholetable to the clipboard which you can use it to paste in the excel sheet.

http://websamples.syncfusion.com/samples/Grid.Windows/F65936/GGC_CopyRecs.zip

Let me know if this helps.

Regards,
Rajagopal


WJ Wen Jiang July 31, 2007 02:08 PM UTC

Hi, Rajagopal,

Thanks! This is helpful.

Wen

>Hi Wen,

The GridGroupingControl.TableModel.ClipboardCopy is the event that gets triggered when copy operation(Ctrl+C) is done. By default, doing ctrl+c will only copy the current cell to the clipboard. If you want to copy something else, say a range of cells/selected records, then in the grid.TableModel.ClipboardCopy event get the Table.SelectedRecords of the corresponding table and put them on the Clipboard.

Here is a small sample to show you how to copy the selected records/wholetable to the clipboard which you can use it to paste in the excel sheet.

http://websamples.syncfusion.com/samples/Grid.Windows/F65936/GGC_CopyRecs.zip

Let me know if this helps.

Regards,
Rajagopal

Loader.
Live Chat Icon For mobile
Up arrow icon