Skip to main content
All docs
V25.1
  • SmartPasteBehaviorProperties.ItemDescriptions Property

    Gets a collection of item descriptions.

    Namespace: DevExpress.AIIntegration.WinForms

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

    NuGet Package: DevExpress.AIIntegration.WinForms

    Declaration

    [Browsable(false)]
    public List<AIItemDescription> ItemDescriptions { get; }

    Property Value

    Type Description
    List<DevExpress.AIIntegration.WinForms.AIItemDescription>

    The collection of item descriptions.

    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.

    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:

    1. AIItemDescription.Item: A component that will receive the pasted data (GridColumn or LayoutControlItem).
    2. AIItemDescription.Description: A string that describes the expected content and/or data format for the item.
    public Form1()
    {
        InitializeComponent();
        behaviorManager1.Attach<SmartPasteBehavior>(gridView1, behavior => {
            behavior.Properties.ItemDescriptions.AddRange(new List<AIItemDescription>() {
                    new AIItemDescription(gridView1.Columns["Price"], "The cost of the product, including any applicable taxes."),
                    new AIItemDescription(gridView1.Columns["ShippingWeight"], "The weight of the product when packaged for shipping (in lbs or kg)."),
                    new AIItemDescription(gridView1.Columns["Dimensions"], "The physical size of the product, typically in length, width, and height."),
                }
            );
            behavior.Properties.ExcludedItems.Add(gridView1.Columns["Rating"]);
        });
    }
    

    Tip

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

    See Also