Version

ClipboardPasting Event

This event is raised when paste operation is initiated.
Syntax
'Declaration
 
Public Event ClipboardPasting As EventHandler(Of ClipboardPastingEventArgs)
public event EventHandler<ClipboardPastingEventArgs> ClipboardPasting
Event Data

The event handler receives an argument of type ClipboardPastingEventArgs containing data related to this event. The following ClipboardPastingEventArgs properties provide information specific to this event.

PropertyDescription
ClipboardValue The original clipboard value that will be pasted.
Values The parsed clipboard value that will be pasted.
Example
This sample demonstrates how to handle the ClipboardPasting event which is fired when selected cells or rows are pasted to a control.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Private Sub targetXamGrid_ClipboardPasting(ByVal sender As Object, ByVal e As Infragistics.Controls.Grids.ClipboardPastingEventArgs)
    Dim collection As New ObservableCollection(Of ProductExtended)()
 
    For Each row In e.Values
        Dim productData = New ProductExtended()
        productData.ProductID = Convert.ToInt32(row(0))
        productData.ProductName = row(1)
        productData.TotalPrice = 
(Convert.ToDecimal(row(2))) * (Convert.ToDecimal(row(3)))
 
        collection.Add(productData)
    Next
    targetXamGrid.ItemsSource = collection
End Sub
void targetXamGrid_ClipboardPasting(object sender, Infragistics.Controls.Grids.ClipboardPastingEventArgs e)
{
    ObservableCollection<ProductExtended> collection = 
new ObservableCollection<ProductExtended>()
    foreach (var row in e.Values)
    {
        ProductExtended productData = new ProductExtended();
        productData.ProductID = Convert.ToInt32(row[0]);
        productData.ProductName = row[1];
        productData.TotalPrice = (Convert.ToDecimal(row[2])) * (Convert.ToDecimal(row[3]));
 
        collection.Add(productData);
    }
 
    targetXamGrid.ItemsSource = collection;
}
<ig:XamGrid x:Name="targetXamGrid" 
    
ClipboardPasting="targetXamGrid_ClipboardPasting" >
</ig:XamGrid>
Requirements

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

See Also