ASPxClientGridView.AddNewRow Method

Adds a new record.


AddNewRow(): void


The AddNewRow method switches the ASPxGridView to edit mode and allows you to add a new row. To add the new record to the underlying datasource, call the ASPxClientGridView.UpdateEdit method. End-users can save the changes made using the Update command.

To initialize row values in code, handle the ASPxGridView.InitNewRow event.

The ASPxGridBase.KeyFieldName property must be specified to enable adding new rows.


<dx:ASPxGridView ClientInstanceName="gv" ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" KeyFieldName="ProductID">
<br />
<dx:ASPxButton ID="ASPxButton1" runat="server" AutoPostBack="False" Text="ASPxButton">
    <ClientSideEvents Click="function(s, e) {
    }" />
See Also