Back to Devexpress

How to: Switch ASPxCardView to an Edit Mode by Double-Clicking a Card

aspnet-114508-components-card-view-examples-how-to-switch-aspxcardview-to-an-edit-mode-by-double-clicking-a-card.md

latest1.0 KB
Original Source

How to: Switch ASPxCardView to an Edit Mode by Double-Clicking a Card

  • Dec 17, 2020

The following example switches ASPxCardView to edit mode when an end user clicks a card. To implement this, handle the ASPxClientCardView.CardDblClick client-side event and call the ASPxClientCardView.StartEditCard method.

aspx
<dx:ASPxCardView ID="ASPxCardView1" KeyFieldName="ID" AutoGenerateColumns="False" runat="server" ClientInstanceName="card">
    <ClientSideEvents CardDblClick="function(s, e) {
        s.StartEditCard(e.visibleIndex);
    }" />
    <Columns>
        <dx:CardViewTextColumn FieldName="ID" VisibleIndex="0">
        </dx:CardViewTextColumn>
        <dx:CardViewTextColumn FieldName="Data" VisibleIndex="1">
        </dx:CardViewTextColumn>
    </Columns>
    <CardLayoutProperties>
         <Items>
        ...
        </Items>
    </CardLayoutProperties>
 </dx:ASPxCardView>