Skip to main content

New Item Row

  • 2 minutes to read
In This Article
NOTE

New Item Row can only be used if a data source implements the IBindingList interface and the IBindingList.AllowNew property is set to true, or if a data source is represented by the ObservableCollection(T) descendant.

A New Item Row is represented by an empty row, which is used by end-users to enter new records. By default it is hidden. To show it, set the TableView.NewItemRowPosition to NewItemRowPosition.Top.

RowTypes

When an end-user starts to edit a new item row, the TableView.InitNewRow event is raised. You can handle this event to initialize required fields within a new record. For instance, you can assign a unique value to the key field and/or assign default field values. To do this, use the grid's GridControl.SetCellValue method. A New Item Row's handle is returned by the DataControlBase.NewItemRowHandle field. To learn more, see Obtaining and Setting Cell Values.

End-users can cancel the appending of a new row by pressing the ESC key while it has focus. If the row's data is valid and the row focus has been moved to another row, the new row is automatically added to the data source and a blank new item row is displayed.

#Examples

#See Also