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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Copying rows between grids

Thread ID:

Created:

Updated:

Platform:

Replies:

21108 Nov 2,2004 04:36 PM UTC Nov 2,2004 05:04 PM UTC WinForms 1
loading
Tags: GridControl
Gordon Rhea
Asked On November 2, 2004 04:36 PM UTC

Hi, 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? Thanks, Gordon

Administrator [Syncfusion]
Replied On November 2, 2004 05:04 PM UTC

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.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon 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.Close Icon

;