DATAROWVIEW

A DataRow object can hold data for more than one state. For example, if a DataTable row has been modified, its DataRow object contains the row’s original data and the modified values.

A DataRowView object represents a view of a DataRow object in a particular state. That state can be Current (the current value), Default (if columns have defined default values), Original (the original values), or Proposed (new values during an edit before EndEdit or CancelEdit is called).

A DataView object holds DataRowView objects representing a view of a DataTable selecting particular rows in a particular state.

The DataRowView object’s purpose is to represent a row in a specific state so this object is relatively simple. It basically indicates the chosen state and refers to a DataRow.

The following table describes the DataRowView object’s most useful properties.

PROPERTY PURPOSE
DataView The DataView that contains the DataRowView.
IsEdit Returns True if the row is in editing mode.
IsNew Returns True if the row is new.
Item Gets or sets the value of one of the row’s fields.
Row The DataRow object that this DataRowView represents.
RowVersion The version of the DataRow represented by this object (Current, Default, Original, or Proposed).

Get Visual Basic 2012 Programmer's Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.