Skip to main content
All docs
V24.2

ASPxClientVerticalGrid.CellSelectionChanging Event

Occurs when you select or deselect a cell.

Declaration

CellSelectionChanging: ASPxClientEvent<ASPxClientVerticalGridCellSelectionChangingEventHandler<ASPxClientVerticalGrid>>

Event Data

The CellSelectionChanging event's data class is ASPxClientVerticalGridCellSelectionChangingEventArgs. The following properties provide information specific to this event:

Property Description
cancel Specifies whether to cancel the related action (for example, row edit, export). Inherited from ASPxClientCancelEventArgs.
cellInfo Gets information about the cell whose selection was changed.
newSelectionState Gets the new selection state of the cell.

Remarks

ASPxVerticalGrid raises the CellSelectionChanging event when you select or deselect a cell. In this event handler, you can get the new selection state of the processed cell (e.newSelectionState) and prevent this cell selection (e.cancel).

Web Forms:

<dx:ASPxVerticalGrid ID="VerticalGrid" runat="server" ...>
    <ClientSideEvents 
        CellSelectionChanging="onCellSelectionChange" />
    <SettingsEditing Mode="Batch">
        <BatchEditSettings EnableMultipleCellSelection="True" />
    </SettingsEditing>
    <Rows>
      <dx:VerticalGridComboBoxRow FieldName="CategoryID" Caption="Category Name" />
      ...
    </Rows>
</dx:ASPxVerticalGrid>
function onCellSelectionChange(s, e) {
    if (e.cellInfo.row.fieldName == 'CategoryID') {
        // your code
        e.cancel = true;
    }
}

MVC:

@Html.DevExpress().VerticalGrid(settings => {
    settings.Name = "verticalGrid";
    settings.ClientSideEvents.CellSelectionChanging = "function (s, e) { 
        if (e.cellInfo.row.fieldName == 'CategoryID') {
          // your code
          e.cancel = true;
        }
    }"; 
    settings.Rows.Add("CategoryID");
    ...
}).Bind(Model).GetHtml()
See Also