I am trying to copy a set of rows, specified by a start position and number of rows, from one grid control to a second grid control. How can I copy these rows and maintain the style info (column width, row heighth, row data, etc) from one grid to another?
ADAdministrator Syncfusion Team November 2, 2004 12:04 PM
If these are non-virtual GridControls, the default copy support should copy all style information for you. But it will not copy things like row height/column widths since this is not part of the GridStyleInfo object.
So, to do this special copy/paste, you can handle the grid.ClipboardCopy event. In the handler, create a custom DataObject holding the information you want to persist, and put this object on the clipboard (setting e.Handled if you do not want the grid to continue its default copy support). Then to do the Paste, you would handle the grid.ClipboardPaste event. In your handler, you would retrieve your custom data object from the clipboard, and set the values from it on the grid.