The requested page is not available for the requested platform. You are viewing the content for Default platform.

ASPxClientCardView.BatchEditStartEditing Event

Occurs when a grid switches to batch edit mode.


BatchEditStartEditing: ASPxClientEvent<ASPxClientCardViewBatchEditStartEditingEventHandler<ASPxClientCardView>>

Event Data

The BatchEditStartEditing event handler receives an argument of the ASPxClientCardViewBatchEditStartEditingEventArgs type. The following properties provide information specific to this event.

Property Description
cancel Gets or sets a value indicating whether the action which raised the event should be canceled.
(Inherited from ASPxClientCancelEventArgs)
cardValues Gets a hashtable that maintains information about editable cells.
focusedColumn Gets the CardView column that owns a cell that is about to be edited.
visibleIndex Gets the visible index of the card whose cells are about to be edited.


The BatchEditStartEditing event is raised when the grid enters the edit mode (for a cell/card) due to an end-user interaction or programmatic call to the ASPxClientCardViewBatchEditApi.StartEdit method. The event provides arguments that allow you to prevent switching a particular cell to the edit mode.

When the CardViewBatchEditSettings.EditMode property is set to Cell, you can set the ASPxClientCancelEventArgs.cancel argument to true to prevent editing the current cell.

When the CardViewBatchEditSettings.EditMode property is set to Card, you can prevent switching particular cells to edit mode using the ASPxClientCardViewBatchEditStartEditingEventArgs.cardValues event argument. This is a hashtable that maintains information about editable cells. You can prevent displaying editors for particular cells by removing the corresponding entries from cardValues.


This example demonstrates how to create an unbound column that calculates the sum of other columns and changes its values on the fly when an end-user changes any grid values using the Batch edit mode.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register assembly="DevExpress.Web.v15.2, Version=, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web" tagprefix="dx" %>

<!DOCTYPE html>

<html xmlns="">
<head runat="server">
    <script type="text/javascript">
        function OnBatchEditEndEditing(s, e) {
            window.setTimeout(function () {
                var price = s.batchEditApi.GetCellValue(e.visibleIndex, "Price");
                var quantity = s.batchEditApi.GetCellValue(e.visibleIndex, "Quantity");
                s.batchEditApi.SetCellValue(e.visibleIndex, "Sum", price * quantity);
            }, 10);
    <form id="form1" runat="server">

        <dx:ASPxCardView ID="Grid" runat="server" KeyFieldName="ID" OnBatchUpdate="ASPxCardView1_BatchUpdate" 
            OnCardInserting="ASPxCardView1_CardInserting" OnCardUpdating="ASPxCardView1_CardUpdating" OnCardDeleting="ASPxCardView1_CardDeleting"             
            OnCustomUnboundColumnData="ASPxCardView1_CustomUnboundColumnData" AutoGenerateColumns="False">
            <ClientSideEvents BatchEditEndEditing="OnBatchEditEndEditing" />
            <SettingsEditing Mode="Batch">
                <dx:CardViewSpinEditColumn FieldName="Quantity" VisibleIndex="0">
                    <PropertiesSpinEdit DisplayFormatString="g">
                <dx:CardViewSpinEditColumn FieldName="Price" VisibleIndex="1">
                    <PropertiesSpinEdit DisplayFormatString="g">
                <dx:CardViewTextColumn FieldName="Sum" ReadOnly="True" UnboundType="Decimal" VisibleIndex="2">
                    <dx:CardViewCommandLayoutItem HorizontalAlign="Right" ShowDeleteButton="True" ShowEditButton="True" ShowNewButton="True">
                    <dx:CardViewColumnLayoutItem ColumnName="Quantity">
                    <dx:CardViewColumnLayoutItem ColumnName="Price">
                    <dx:CardViewColumnLayoutItem ColumnName="Sum">
                    <dx:EditModeCommandLayoutItem HorizontalAlign="Right">

See Also