asp.net.ph

DataView.AllowNew Property

System.Data Namespace   DataView Class


Sets or retrieves a value indicating whether the new rows can be added using the AddNew method.

Syntax


Script DataView.AllowNew [ = true | false ]

Property Value

This property accepts or returns only a boolean value: true, if new rows can be added; otherwise, false.

Example

The following example sets the AllowNew property before adding a new row with the AddNew method.

private void AddRow ( ) {
   DataTable myTable = new DataTable ( );
   // code to populate DataTable here.
   DataView dv = new DataView ( myTable );
   dv.AllowNew = true;
   DataRowView drv = dv.AddNew ( );
   drv [ "ProductName" ] = "New Product Name";
}
  C# VB

See Also

DataView Members   AddNew   AllowDelete   AllowEdit   DataRowView Skip Navigation Links




Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note