This sample illustrates how to copy and paste data, including its formatting, from a grid control to Excel and vice versa. In order to achieve this, the sample retrieves the BIFF-formatted object of the clipboard and pastes the data into the grid cells.
Features
To paste formatted Data from Excel to a Grid:
Data is retrieved from the clipboard(it should be in BIFF format).
Data range is calculated.
Data is retrieved from each cell in the calculated range in a corresponding grid cell.
To paste formatted data from Grid to Excel:
The GridStyleInfo object of each cell in the active range is retrieved and copied into the Excel cell.