Hi Aljoul,
In WinForms
SfDataGrid, the CopyContent event does not provide the copied records directly.
However, you can retrieve the records using the SelectedItems of the
corresponding business object. If you want to get the type of the copied
records directly from the CopyContent event without using SelectedItems, you
can retrieve the copied records manually from the clipboard. However, it is not
possible to determine the type of the copied records from the clipboard because
the data is stored as plain text, which loses the original data type
information. Therefore, we recommend retrieving the type from SelectedItems, or
if you are performing a multiple selection, use SelectedRecords. Please refer
to the code snippet below for obtaining the type of the copied records:
Code Snippet:
|
private void
SfDataGrid1_CopyContent(object sender,
Syncfusion.WinForms.DataGrid.Events.CutCopyPasteEventArgs e)
{
var data = (e.OriginalSender as SfDataGrid).SelectedItem
as OrderInfo;
var dataType = data.GetType();
}
|
Additionally,
we are a little unclear about your PasteContent event. Could you clarify what
you want to do with the copied records Type in the PasteContent event?
Providing these
details will help us better understand the issue and work towards finding a
solution promptly.
Thank you for
your understanding and cooperation.
Best Regards,
Gokul S