DataView.AllowDelete Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Sets or gets a value that indicates whether deletes are allowed.

Namespace:   System.Data
Assembly:  System.Data (in System.Data.dll)

public bool AllowDelete { get; set; }

Property Value

Type: System.Boolean

true, if deletes are allowed; otherwise, false.

The following example checks the AllowDelete property before deleting a DataRow from a DataView.

private void CheckAllowDelete(DataRow rowToDelete)
{
    DataView view = new DataView(DataSet1.Tables["Suppliers"]);
    if (view.AllowDelete)
        rowToDelete.Delete();
}

.NET Framework
Available since 1.1
Return to top
Show: