ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

C1TrueDBGrid.AllowAddNew Property

Gets or sets a value indicating the ability to add new rows.

[Visual Basic]

Public Property AllowAddNew As Boolean

[C#]

public bool AllowAddNew {get;set;}

[Delphi]

public property AllowAddNew: Boolean read get_AllowAddNew write set_AllowAddNew;

Remarks

If True, the user can add records to the data source underlying the C1TrueDBGrid control.

If False (the default), the user cannot add records to the data source underlying the C1TrueDBGrid control.

If the AllowAddNew property is True, the last row displayed in the grid is left blank to permit users to enter new records. If the AllowAddNew property is False, the blank row (usually referred to as the AddNew row) is not displayed.

The underlying data source may not permit insertions even if the AllowAddNew property is True for the C1TrueDBGrid control. In this case, a trappable error occurs when the user tries to add a record.

If AllowAddNew is True, also set AllowUpdate to True (the default) so that users will be able to type in the cells of the AddNew row.

Example

For an example using the AllowAddNew property, see Adding a New Row to C1TrueDBGrid.

See Also

C1TrueDBGrid Class | C1TrueDBGrid Members | C1.Win.C1TrueDBGrid Namespace


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.