Gets or sets a value indicating whether the new rows can be added using the AddNew method.
[Visual Basic] Public Property AllowNew As Boolean [C#] public bool AllowNew {get; set;} [C++] public: __property bool get_AllowNew(); public: __property void set_AllowNew(bool); [JScript] public function get AllowNew() : Boolean; public function set AllowNew(Boolean);
true, if new rows can be added; otherwise, false.
The following example sets the AllowNew property to true before adding a new row with the AddNew method.
[Visual Basic]
Private Sub AddNew() Dim myTable As DataTable myTable = New DataTable ' Not shown: code to populate DataTable. Dim dv As DataView dv = New DataView(myTable) dv.AllowNew = True Dim drv As DataRowView drv = dv.AddNew drv("ProductName") = "New Product Name" End Sub
DataView Class | DataView Members | System.Data Namespace | AddNew | DataRowView