GridControl.InitNewRow Event

Enables you to initialize newly added rows.

Namespace: DevExpress.Mobile.DataGrid

Assembly: DevExpress.Mobile.Grid.v18.1.dll

Declaration

public event InitNewRowEventHandler InitNewRow
Public Event InitNewRow As InitNewRowEventHandler

The event handler receives an argument of the InitNewRowEventHandler type.

You can handle the InitNewRow event to initialize newly added rows. To initialize row cells, call the IEditableRowData.SetFieldValue of the IEditableRowData object returned by the event's InitNewRowEventArgs.EditableRowData parameter.

The InitNewRow event is raised when an end-users taps New Item Row in the grid.

Examples

The following code shows how to initialize the "Date" field of a new row via the GridControl.InitNewRow event.

using DevExpress.Mobile.DataGrid;

// ...

void OnInitNewRow(object sender, InitNewRowEventArgs e) {
    e.EditableRowData.SetFieldValue ("Date", DateTime.Today);
}

See Also