Skip to main content
A newer version of this page is available. .

ClipboardRowCopyingEventArgs.Values Property

Gets information about the copied grid element (a column headers collection, group row, or data row) with its appearance settings.

Namespace: DevExpress.WinUI.Grid

Assembly: DevExpress.WinUI.Grid.v22.1.dll

NuGet Package: DevExpress.WinUI

Declaration

public ClipboardValueInfoCollection Values { get; }

Property Value

Type Description
ClipboardValueInfoCollection

Information about the copied grid element (a column headers collection, group row, or data row) with its appearance settings.

Example

The GridControl raises the ClipboardRowCopying event for each copied row. The event considers the column header row as the first copied row if the CopyColumnHeadersToClipboard property is set to true.

This event allows you to modify the copy operation. For example, you can change copied values, skip a row, or customize row appearance.

The following code sample adds group summaries to the copied group rows and changes the background of group rows:

WinUI Grid - ClipboardRowCopying Event

<dxg:GridControl ...
                 x:Name="grid"
                 CopyColumnHeadersToClipboard="True"
                 ClipboardRowCopying="grid_ClipboardRowCopying">
    <dxg:GridControl.GroupSummary>
        <dxg:GridGroupSummaryItem x:Name="groupSummary" FieldName="UnitPrice" SummaryType="Max"/>
    </dxg:GridControl.GroupSummary>
    <!-- ... -->
</dxg:GridControl>
using Microsoft.UI;
using Microsoft.UI.Xaml.Media;
// ...

void grid_ClipboardRowCopying(object sender, DevExpress.WinUI.Grid.ClipboardRowCopyingEventArgs e) {
    if (e.Type == ClipboardInfoType.Group) {
        var group = e.Values[0];
        group.Value = group.DisplayValue + $" (Max of Unit Price is ${grid.GetGroupSummaryValue(e.RowHandle, groupSummary)})";
        group.Background = new SolidColorBrush(Colors.LightGray);
    }
}
See Also