Skip to main content

How to: Add and Initialize a New Row

This example handles the ASPxGridView.InitNewRow event to initialize the new record’s field values with default values.

The image below shows the result:

exInitNewRow

protected void grid_InitNewRow(object sender, DevExpress.Web.Data.ASPxDataInitNewRowEventArgs e) {
    e.NewValues["BirthDate"] = new DateTime(1970, 1, 10);
    e.NewValues["Title"] = "Sales Representative";
}