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. Image for the cookie policy date

ClipboardCopy Event

When the user does a ctrl-c, I want to copy an id field from the underlying datasource for that row. Both on a single cell or range. Can I drill down to that information in the GridCutPasteEventArgs or do I need to attach to other events and track this separately? How can accomplish this?

3 Replies

AD Administrator Syncfusion Team February 14, 2004 07:22 PM UTC

One way you could possibly do this is to catch ClipboardCopy, add the information you want to the clipboard as a custom object, and then handle ClipboardPaste and retrieve your custom object and use it. Here is a little sample.

DF Doug Finke February 15, 2004 03:46 PM UTC

Thanks Clay, This looks good. With the GridCutPasteEventArgs, can the row and col be determined? I need to retrieve information from the datasource to set in e.DataObject.SetData.

AD Administrator Syncfusion Team February 15, 2004 06:34 PM UTC

In the copy event, you would need to get the currentcell from the grid if that is what you want (grid.CurrentCell.RowIndex, grid.CurrentCell.ColIndex). Or if you want the active range. you would use GridRangeInfoList ranges; this.GridRangeInfoList.Selections.GetSelectedRanges(out ranges, true); // ranges.ActiveRange // the active range

Live Chat Icon For mobile
Up arrow icon