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.
The ClipboardCopy event is fired when the content is copied from the Grid’s TableModel.
This method is used to copy the Selected Records and add it to the Clipboard object as a string.
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.
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
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|