SmartPasteBehavior.Properties Property
Gets SmartPaste behavior settings.
Namespace: DevExpress.AIIntegration.WinForms
Assembly: DevExpress.AIIntegration.WinForms.v25.2.dll
NuGet Package: DevExpress.AIIntegration.WinForms
Declaration
Property Value
| Type | Description |
|---|---|
| SmartPasteBehaviorProperties | SmartPaste behavior settings. |
Remarks
Once you attached the SmartPasteBehavior to a control, you should describe items so that SmartPaste can assign right values to appropriate items. In the context of SmartPaste, an item refers to a LayoutControlItem when working with a LayoutControl, or a GridColumn when working with a GridControl.
Item Descriptions
Note
Item descriptions are optional if an item’s text or caption is specified (for example, a grid column’s Caption property or layout item’s Text property is set to a non-empty string). Although SmartPaste attempts to determine the right value for an item based on the item’s text/caption, we recommend that you also describe items for improved accuracy.
Use the SmartPasteBehavior.Properties.ItemDescriptions collection property to add descriptions (AIItemDescription) for certain items. Each AIItemDescription object in the collection has two properties:
AIItemDescription.Item: A component that will receive the pasted data (GridColumn or LayoutControlItem).AIItemDescription.Description: A string that describes the expected content and/or data format for the item.
Excluded Items
If you want to exclude a specific item from SmartPaste, you can add this item to the ExcludedItems collection. This allows you to exclude grid columns or data fields from being affected by SmartPaste, ensuring that they remain unchanged.
Process Clipboard Image
Enable the ProcessClipboardImage option to analyze images copied to the clipboard. SmartPaste checks whether the clipboard contains an image and attempts to extract structured data from it using AI.
Example
The following code snippet registers a SmartPasteBehavior and assigns it to an AdvBandedGridView. It uses the AI-powered SmartPaste extension to analyze clipboard content (text or image data) and automatically fill grid columns with structured data. The extension is configured to always return results in English.
public Form1() {
InitializeComponent();
behaviorManager1.Attach<SmartPasteBehavior>(advBandedGridView1, behavior => {
behavior.Properties.PromptAugmentation = "Always translate the result into English.";
behavior.Properties.ItemDescriptions.AddRange(new List<AIItemDescription>() {
new AIItemDescription(advBandedGridView1.Columns["ProductName"], "Official name or product name."),
new AIItemDescription(advBandedGridView1.Columns["ShippingWeight"], "Weight of the product when packaged for shipping (in lbs or kg)."),
new AIItemDescription(advBandedGridView1.Columns["ProductDimensions"], "Physical size of TV without stand, typically in length, width, and height (in inches or mm)."),
new AIItemDescription(advBandedGridView1.Columns["ShippingDimensions"], "Physical size of shipping package, typically in length, width, and height (in inches or mm)."),
new AIItemDescription(advBandedGridView1.Columns["Warranty"], "Information related to the product warranty (in years or months)."),
}
);
behavior.Properties.ExcludedItems.Add(advBandedGridView1.Columns["Notes"]);
behavior.Properties.ProcessClipboardImage = DevExpress.Utils.DefaultBoolean.True;
});
}
Tip
Read the following help topic for additional information: Smart Paste AI-powered Extension.