Back to Devexpress

ASPxClientGridViewClipboardCellPastingEventArgs Class

aspnet-js-aspxclientgridviewclipboardcellpastingeventargs.md

latest1.9 KB
Original Source

ASPxClientGridViewClipboardCellPastingEventArgs Class

Contains data for the ClipboardCellPasting event.

Declaration

ts
declare class ASPxClientGridViewClipboardCellPastingEventArgs extends ASPxClientCancelEventArgs

Remarks

The following example illustrates how to modify data before pasting to the control in the ClipboardCellPasting event handler:

Web Forms:

aspx
<dx:ASPxGridView ID="GridView" runat="server" ...>
    <ClientSideEvents 
        ClipboardCellPasting="onClipboardCellPasting" />
    <SettingsEditing Mode="Batch">
        <BatchEditSettings EnableMultipleCellSelection="True" />
    </SettingsEditing>
</dx:ASPxGridView>
js
function onClipboardCellPasting(s, e) {
    if (e.cellInfo.column.fieldName == 'CategoryID') {
        // your code
        e.cancel = true;
    }
    else {
      e.newText += " copy"; 
    }
}

MVC:

cshtml
@Html.DevExpress().GridView(settings => {
    settings.Name = "grid";
    settings.ClientSideEvents.CellSelectionChanging = "function (s, e) { 
        if (e.cellInfo.column.fieldName == 'CategoryID') {
            // your code
            e.cancel = true;
        }
        else {
          e.newText += " copy"; 
        }
    }"; 
    settings.Columns.Add("CategoryID");
    ...
}).Bind(Model).GetHtml()

Inheritance

ASPxClientEventArgs ASPxClientCancelEventArgs ASPxClientGridViewClipboardCellPastingEventArgs

See Also

ASPxClientGridViewClipboardCellPastingEventArgs Members