This documentation is archived and is not being maintained.

DataRow.Item Property (DataColumn, DataRowVersion)

Gets the specified version of data stored in the specified DataColumn.

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

public Object this[
	DataColumn column,
	DataRowVersion version
] { get; }


Type: System.Data.DataColumn
A DataColumn that contains information about the column.
Type: System.Data.DataRowVersion
One of the DataRowVersion values that specifies the row version that you want. Possible values are Default, Original, Current, and Proposed.

Property Value

Type: System.Object
An Object that contains the data.


The column does not belong to the table.


The column argument contains null.


The row does not have this version of data.

The version should not be confused with the RowState property. The version argument describes the state of the data that is contained by the column relative to the column's original value.

When you set the property, an exception is generated if an exception occurs in the ColumnChanging event.

If this is an immediate edit, see EndEdit for the exceptions that can be generated.

The following example gets the current value of a clicked cell in the DataGrid control.

private void DataGrid1_Click(object sender, 
    System.EventArgs e) 
    DataTable dataGridTable = 

    // Set the current row using the RowNumber 
    // property of the CurrentCell.
    DataRow currentRow = dataGridTable.Rows[DataGrid1.CurrentCell.RowNumber];
    DataColumn column = dataGridTable.Columns[1];

    // Get the value of the column 1 in the DataTable.
    Console.WriteLine(currentRow[column, DataRowVersion.Current]);

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.