Export (0) Print
Expand All

DataRowView.RowVersion Property

Gets the current version description of the DataRow.

[Visual Basic]
Public ReadOnly Property RowVersion As DataRowVersion
[C#]
public DataRowVersion RowVersion {get;}
[C++]
public: __property DataRowVersion get_RowVersion();
[JScript]
public function get RowVersion() : DataRowVersion;

Property Value

One of the DataRowVersion values. Possible values for the RowVersion property are: Default, Original, Current, and Proposed.

Remarks

For more details, see DataRowVersion.

Example

[Visual Basic, C#, C++] The following example uses the RowVersion property to determine the state of a row in the DataRowView.

[Visual Basic] 
Private Sub ShowModifiedCurrentRows()
    Dim dv As DataView = CType(dataGrid1.DataSource, DataView)
    ' Set the filter to display only those rows that were modified.
    dv.RowStateFilter = DataViewRowState.ModifiedCurrent
    ' Change the value of the CompanyName column for each modified row.
    Dim drv As DataRowView
    For Each drv In  dv
        Console.WriteLine(drv)
    Next drv
End Sub

[C#] 
private void ShowModifiedCurrentRows(){
   DataView dv = (DataView) dataGrid1.DataSource;
   // Set the filter to display only those rows that were modified.
   dv.RowStateFilter=DataViewRowState.ModifiedCurrent;
   // Change the value of the CompanyName column for each modified row.
   foreach(DataRowView drv in dv){
      Console.WriteLine(drv);
   }
}

[C++] 
private:
 void ShowModifiedCurrentRows(){
    DataView* dv = dynamic_cast<DataView*> (dataGrid1->DataSource);
    // Set the filter to display only those rows that were modified.
    dv->RowStateFilter=DataViewRowState::ModifiedCurrent;
    // Change the value of the CompanyName column for each modified row.
    System::Collections::IEnumerator* myEnum = dv->GetEnumerator();
    while (myEnum->MoveNext())
    {
       DataRowView* drv = __try_cast<DataRowView*>(myEnum->Current);
       Console::WriteLine(drv);
    }
 }

[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

DataRowView Class | DataRowView Members | System.Data Namespace | AcceptChanges | BeginEdit | DataRowVersion | EndEdit

Show:
© 2014 Microsoft