'Declaration Public Event ClipboardCopyingItem As EventHandler(Of ClipboardCopyingItemEventArgs)
public event EventHandler<ClipboardCopyingItemEventArgs> ClipboardCopyingItem
The event handler receives an argument of type ClipboardCopyingItemEventArgs containing data related to this event. The following ClipboardCopyingItemEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Cancel (Inherited from Infragistics.CancellableEventArgs) | |
Cell | Gets the cell being copied to the clipboard. |
ClipboardValue | Gets or sets the Value of the cell being copied to the clipboard. |
Private Sub xamGrid_ClipboardCopyingItem(ByVal sender As Object, ByVal e As ClipboardCopyingItemEventArgs) ' Get the reference to the cell that will be copied Dim selectedCell As CellBase = e.Cell ' The headers cells style will not be changed If selectedCell.Row.RowType <> RowType.HeaderRow Then ' Add verification for valid data in a data cell. ' In this case, the negative values cells in UnitsOnOrder columnwill not be copied. If selectedCell.Column.Key.Equals("UnitsOnOrder") AndAlso Convert.ToInt32(e.Cell.Value) <= 0 Then e.Cancel = True Return End If ' Set the new style to the cells that will be copied selectedCell.Style = TryCast(Me.Resources("grayCellStyle"), Style) End If End Sub
void xamGrid_ClipboardCopyingItem(object sender, ClipboardCopyingItemEventArgs e) { // Get the reference to the cell that will be copied CellBase selectedCell = e.Cell; // The headers cells style will not be changed if (selectedCell.Row.RowType != RowType.HeaderRow) { // Add verification for valid data in a data cell. // In this case, the negative values cells in UnitsOnOrder column will not be copied. if (selectedCell.Column.Key.Equals("UnitsOnOrder") && Convert.ToInt32(e.Cell.Value) <= 0) { e.Cancel = true; return; } // Set the new style to the cells that will be copied selectedCell.Style = this.Resources["grayCellStyle"] as Style; } }
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2