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.
Unfortunately, activation email could not send to your email. Please try again.

How to copy and paste the Nested table records from the GridGroupingControl to Excel?

To copy and paste the Nested table records from the GridGroupingControl to Excel, you must first copy the Grid content to the Clipboard. This is achieved by handling the ClipboardCopy event. In the event, the selected records are copied by iterating through the Nested table collection by using the GetTable method. This iterating loop spans through their columns to get values. These values are appended to a string variable and finally copied to the Clipboard as strings by using the Clipboard.SetDataObject() method.

  • ClipboardCopy Event:

The ClipboardCopy event is fired when the content is copied from the Grid’s TableModel.

C#

VB

  • CopySelectedRecords Method:

This method is used to copy the Selected Records and add it to the Clipboard object as a string.

C#

VB

  • CopySelectedRecordsToBuffer Method:

In this method, the selected records are added in the buffer string with the visible column descriptor. It has the same appearance as the nested table records when the Clipboard content is pasted to the Excel sheet.

C#

VB

The following screenshot displays the selected Record copied with the nested Records to the clipboard and then to the Excel sheet.

 

Figure 1: The selected Record is copied with the nested Records to the clipboard

Figure 2: Clipboard content copied to the Excel sheet

Sample Links:

CopyPasteToExcel-C#-1220698826.zip

CopyPasteToExcel-VB-858778125.zip

Article ID: Published Date: Last Revised Date: Platform: Control:
727 04/30/2011 03/06/2015 Windows Forms GridGroupingControl
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.