Back to Devexpress

ASPxClientGridViewCellSelectionChangingEventArgs Class

aspnet-js-aspxclientgridviewcellselectionchangingeventargs.md

latest1.9 KB
Original Source

ASPxClientGridViewCellSelectionChangingEventArgs Class

Contains data for the CellSelectionChanging event.

Declaration

ts
declare class ASPxClientGridViewCellSelectionChangingEventArgs extends ASPxClientCancelEventArgs

Remarks

The ASPxClientGridViewBatchEditRowDeletingEventArgs object is used as an argument for the client-side CellSelectionChanging event.

Web Forms:

aspx
<dx:ASPxGridView ID="GridView" runat="server" ...>
    <ClientSideEvents 
        CellSelectionChanging="onCellSelectionChange" />
    <SettingsEditing Mode="Batch">
        <BatchEditSettings EnableMultipleCellSelection="True" />
    </SettingsEditing>
    <Columns>
      <dx:GridViewDataComboBoxColumn FieldName="CategoryID" Caption="Category Name" />
      ...
    </Columns>
</dx:ASPxGridView>
js
function onCellSelectionChange(s, e) {
    if (e.cellInfo.column.fieldName == 'CategoryID') {
        // your code
        e.cancel = true;
    }
}

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;
        }
    }"; 
    settings.Columns.Add("CategoryID");
    ...
}).Bind(Model).GetHtml()

Inheritance

ASPxClientEventArgs ASPxClientCancelEventArgs ASPxClientGridViewCellSelectionChangingEventArgs

See Also

ASPxClientGridViewCellSelectionChangingEventArgs Members