<ig:XamGrid x:Name="xamGrid" … > <ig:XamGrid.ClipboardSettings> <ig:ClipboardSettings AllowCopy="True" CopyType="SelectedRows"/> </ig:XamGrid.ClipboardSettings> </ig:XamGrid>
Please note that this control has been retired and is now obsolete to the XamDataGrid control, and as such, we recommend migrating to that control. It will not be receiving any new features, bug fixes, or support going forward. For help or questions on migrating your codebase to the XamDataGrid, please contact support.
When copy operation is enabled in the xamGrid control, you can copy a random selection of data to the clipboard and after that paste it in the proper format into a Microsoft® Excel® worksheet. This data selection includes a collection of cells or rows.
If you need more control over the copied data, you can configure the ClipboardSettings object’s CopyType property which can have as a value one of the following options of the GridClipboardCopyType enumeration:
SelectedCells - Only selected cells will be copied.
SelectedRows - Only selected rows will be copied.
Default - The value of the SelectionSettings object’s CellClickAction property specifies whether a cell or row collection will be copied.
The following code demonstrates how to use copy operation.
In XAML:
<ig:XamGrid x:Name="xamGrid" … > <ig:XamGrid.ClipboardSettings> <ig:ClipboardSettings AllowCopy="True" CopyType="SelectedRows"/> </ig:XamGrid.ClipboardSettings> </ig:XamGrid>
In code-behind:
In Visual Basic:
Imports Infragistics.Controls.Grids
'Set the copy operation settings
xamGrid.ClipboardSettings.AllowCopy = True
xamGrid.ClipboardSettings.CopyType = GridClipboardCopyType.SelectedRows
In C#:
using Infragistics.Controls.Grids; // Set copy operation settings igGrid.ClipboardSettings.AllowCopy = true; igGrid.ClipboardSettings.CopyType = GridClipboardCopyType.SelectedRows;