ASPxGridViewCommandButtonSettings.EditButton Property
Gets the Edit command button‘s settings.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.2.dll
NuGet Package: DevExpress.Web
#Declaration
public GridViewCommandButtonSettings EditButton { get; }
#Property Value
Type | Description |
---|---|
Grid |
A Grid |
#Property Paths
You can access this nested property as listed below:
Library | Object Type | Path to Edit |
---|---|---|
ASP. |
Grid |
|
MVCx |
|
|
ASP. |
ASPx |
|
Grid |
|
#Remarks
The Edit button switches the ASPxGridView to edit mode. Use the EditButton property to specify the button’s image, caption and type. The button’s visibility in a column is specified by the GridViewCommandColumn.ShowEditButton property.
The following example illustrates how to show the Edit command button as a button with an image.
<dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" KeyFieldName="ProductID">
<Columns>
...
<dx:GridViewCommandColumn ShowEditButton="true"></dx:GridViewCommandColumn>
</Columns>
<SettingsCommandButton>
<EditButton RenderMode="Button" Text="Edit Record">
<Image ToolTip="Click button to edit" Url="icon.png" AlternateText="Edit Record" />
</EditButton>
</SettingsCommandButton>
</dx:ASPxGridView>
Note that the Edit command button’s GridCommandButtonSettings.Text property value is not encoded by default. Use the ASPxGridViewCommandButtonSettings.EncodeHtml property to specify whether to display the button’s text that is HTML as HTML, or instead, strip out the HTML markers.
<SettingsCommandButton EncodeHtml="true">
<EditButton>
...
</EditButton>
</SettingsCommandButton>
Note
Specify the ASPx