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?
ADAdministrator Syncfusion Team February 14, 2004 02:22 PM
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.
DFDoug FinkeFebruary 15, 2004 10:46 AM
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.
ADAdministrator Syncfusion Team February 15, 2004 01:34 PM
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
this.GridRangeInfoList.Selections.GetSelectedRanges(out ranges, true);
// ranges.ActiveRange // the active range