Skip to main content
A newer version of this page is available. .

How to: Initialize Cells in Newly Created Rows

The following code shows how to initialize the “PurchaseDate” field of a new row via the ColumnView.InitNewRow event.

using DevExpress.XtraGrid.Views.Grid;

private void gridView1_InitNewRow(object sender, InitNewRowEventArgs e) {
   GridView view = sender as GridView;
   view.SetRowCellValue(e.RowHandle, view.Columns["PurchaseDate"], DateTime.Today);
}