NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DataView.AllowNew

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);

Property Value

true, if new rows can be added; otherwise, false.

Example [Visual Basic]

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

See Also

DataView Class | DataView Members | System.Data Namespace | AddNew | DataRowView