Tab
A newer version of this page is available. Switch to the current version.

GridViewCommandColumn.ShowNewButton Property

Specifies whether the New command button is displayed in the command column.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v18.2.dll

Declaration

[DefaultValue(false)]
public bool ShowNewButton { get; set; }

Property Value

Type Default Description
Boolean

false

true, if the button is visible; otherwise, false.

Remarks

Use the ShowNewButton property to specify whether the New button is visible in the command column. To display the button in the command column header, set the GridViewCommandColumn.ShowNewButtonInHeader property to true. The button settings can be customized using the ASPxGridViewCommandButtonSettings.NewButton property.

NOTE

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

Declaratively:

<dx:ASPxGridView ID="ASPxGridView1" runat="server" >
    <Columns>  
        <dx:GridViewCommandColumn ShowNewButton="True" />  
        ...
    </Columns>  
</dx:ASPxGridView>

In code:

using DevExpress.Web;
...
protected void Page_Load(object sender, EventArgs e)  {
    ASPxGridView grid1 = new ASPxGridView();
    grid1.ID = "grid1";
    Page.Form.Controls.Add(grid1);
    ...
    GridViewCommandColumn commandColumn = new GridViewCommandColumn();
    commandColumn.ShowNewButton = true;
    grid1.Columns.Add(commandColumn);
    ...
}
See Also