Skip to main content

Edit Data

Run Demo

Follow the steps below to allow users to edit data:

  1. Specify the ASPxGridBase.KeyFieldName property.

  2. Use the Mode property to specify the control’s edit mode. The default mode is EditForm.

  3. Add the command layout item (CardViewCommandLayoutItem) to the control’s layout.

  4. Add command buttons.

    Command Button

    Setting

    Delete

    ShowDeleteButton

    Edit

    ShowEditButton

    New

    ShowNewButton

    Recover

    ShowRecoverButton

    Select (button)

    ShowSelectButton

    Select (check box)

    ShowSelectCheckbox

<dx:ASPxCardView ID="CardView" runat="server">
    <Columns>
        <dx:CardViewTextColumn FieldName="FirstName" />
        <dx:CardViewTextColumn FieldName="LastName" />
        <dx:CardViewTextColumn FieldName="Title" Caption="Position" />
    </Columns>
    <CardLayoutProperties>
        <Items>
            <dx:CardViewCommandLayoutItem 
                ShowEditButton="true" 
                ShowNewButton="true" 
                ShowDeleteButton="true" 
                HorizontalAlign="Right" />
            <dx:CardViewColumnLayoutItem ColumnName="FirstName" />
            <dx:CardViewColumnLayoutItem ColumnName="LastName" />
            <dx:CardViewColumnLayoutItem ColumnName="Title" />
        </Items>
    </CardLayoutProperties>
</dx:ASPxCardView>

CardView - Edit Data

You can use the ASPxGridDataSecuritySettings.AllowEdit, ASPxGridDataSecuritySettings.AllowDelete and ASPxGridDataSecuritySettings.AllowInsert properties to restrict edit, delete, and insert operations.

<dx:ASPxCardView ID="CardView" runat="server">
    ...
    <SettingsDataSecurity AllowDelete="false" AllowEdit="false" AllowInsert="false" />
</dx:ASPxCardView>
See Also