Export (0) Print
Expand All

DataView.AllowEdit Property

Gets or sets a value indicating whether edits are allowed.

[Visual Basic]
Public Property AllowEdit As Boolean
[C#]
public bool AllowEdit {get; set;}
[C++]
public: __property bool get_AllowEdit();
public: __property void set_AllowEdit(bool);
[JScript]
public function get AllowEdit() : Boolean;
public function set AllowEdit(Boolean);

Property Value

true, if edits are allowed; otherwise, false.

Example

[Visual Basic, C#, C++] The following example invokes the AllowEdit method before editing a row in a DataView.

[Visual Basic] 
Private Sub EditRow(dv As DataView)
   dv.AllowEdit = True
   dv(0).BeginEdit
   dv(0)("FirstName") = "Mary"
   dv(0)("LastName") = "Jones"
   dv(0).EndEdit
End Sub

[C#] 
private void EditRow(DataView dv)
{
   dv.AllowEdit = true;
   dv[0].BeginEdit();
   dv[0]["FirstName"] = "Mary";
   dv[0]["LastName"] = "Jones";
   dv[0].EndEdit();
}

[C++] 
private:
 void EditRow(DataView* dv)
 {
    dv->AllowEdit = true;
    dv->Item[0]->BeginEdit();
    dv->Item[0]->Item[S"FirstName"] = S"Mary";
    dv->Item[0]->Item[S"LastName"] = S"Jones";
    dv->Item[0]->EndEdit();
 }

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

DataView Class | DataView Members | System.Data Namespace | AllowDelete | AllowNew | BeginEdit

Show:
© 2014 Microsoft