Back to Devexpress

ASPxCardViewCommandButtonSettings.EditButton Property

aspnet-devexpress-dot-web-dot-aspxcardviewcommandbuttonsettings-577bc601.md

latest3.8 KB
Original Source

ASPxCardViewCommandButtonSettings.EditButton Property

Gets the Edit command button‘s settings.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public CardViewCommandButtonSettings EditButton { get; }
vb
Public ReadOnly Property EditButton As CardViewCommandButtonSettings

Property Value

TypeDescription
CardViewCommandButtonSettings

A CardViewCommandButtonSettings object that specifies the button’s settings.

|

Property Paths

You can access this nested property as listed below:

LibraryObject TypePath to EditButton
ASP.NET MVC ExtensionsCardViewSettings

.SettingsCommandButton .EditButton

| | ASP.NET Web Forms Controls | ASPxCardView |

.SettingsCommandButton .EditButton

|

Remarks

The Edit button switches the ASPxCardView to edit mode. Use the EditButton property to specify the button’s image, caption and type. The button’s visibility is specified by the CardViewCommandLayoutItem.ShowEditButton property.

The following example illustrates how to show the Edit command button as a button with an image.

aspx
<dx:ASPxCardView ID="ASPxCardView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" KeyFieldName="ProductID">
    <Columns>
    ...
    </Columns>
    <CardLayoutProperties>
        <Items>
            <dx:CardViewCommandLayoutItem HorizontalAlign="Right" ShowEditButton="True">
            </dx:CardViewCommandLayoutItem>
            ...
        </Items>
    </CardLayoutProperties>
    <SettingsCommandButton>
        <EditButton RenderMode="Button" Text="Edit Record">
            <Image ToolTip="Click button to edit" Url="icon.png" AlternateText="Edit Record" />
        </EditButton>
    </SettingsCommandButton>
</dx:ASPxGridView>

Note

The Edit command button’s GridCommandButtonSettings.Text property value is not encoded by default. Use the ASPxCardViewCommandButtonSettings.EncodeHtml property to specify whether to display the button’s text that is HTML as HTML, or instead, strip out the HTML markers.

csharp
<SettingsCommandButton EncodeHtml="true">
    <EditButton>
    ...
    </EditButton>
</SettingsCommandButton>

Note

Specify the ASPxGridBase.KeyFieldName property when you add a new and delete an existing card.

See Also

Card View

ShowEditButton

ASPxCardViewCommandButtonSettings Class

ASPxCardViewCommandButtonSettings Members

DevExpress.Web Namespace