Back to Devexpress

SmartPasteBehavior.SmartPasteAsync() Method

windowsforms-devexpress-dot-aiintegration-dot-winforms-dot-smartpastebehavior.md

latest2.0 KB
Original Source

SmartPasteBehavior.SmartPasteAsync() Method

Assigns the right values (from the clipboard) to the appropriate items.

Namespace : DevExpress.AIIntegration.WinForms

Assembly : DevExpress.AIIntegration.WinForms.v25.2.dll

NuGet Package : DevExpress.AIIntegration.WinForms

Declaration

csharp
public Task SmartPasteAsync()
vb
Public Function SmartPasteAsync As Task

Returns

TypeDescription
Task

The task.

|

Remarks

The following code snippet handles the GridView’s KeyDown event to invoke SmartPaste when a user presses Alt+P:

csharp
async void GridView1_KeyDown(object sender, KeyEventArgs e) {
    if (e.KeyCode == Keys.P && e.Modifiers == Keys.Alt)
        await behaviorManager1.GetBehavior<SmartPasteBehavior>(gridView1).SmartPasteAsync();
}
vb
Async Sub GridView1_KeyDown(ByVal sender As Object, ByVal e As KeyEventArgs)
  If e.KeyCode = Keys.P AndAlso e.Modifiers = Keys.Alt Then
    Await behaviorManager1.GetBehavior(Of SmartPasteBehavior)(gridView1).SmartPasteAsync()
  End If
End Sub

Read the following help topic for additional information: Smart Paste AI-powered Extension.

See Also

SmartPasteBehavior Class

SmartPasteBehavior Members

DevExpress.AIIntegration.WinForms Namespace