System.Web.UI.WebControls.DetailsView.DataItem Property

Gets the data item bound to the System.Web.UI.WebControls.DetailsView control.

Syntax

[System.ComponentModel.Browsable(false)]
[System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
public virtual object DataItem { get; }

Value

Documentation for this section has not yet been entered.

Remarks

Use the DetailsView.DataItem property to access the data item bound to the System.Web.UI.WebControls.DetailsView control. The data item is often used to access the field values of the current record directly. The type of the object returned by this property varies depending on the data source. For example, when a System.Web.UI.WebControls.SqlDataSource control is bound to the System.Web.UI.WebControls.DetailsView control, a System.Data.DataRowView object is returned.

Note:

This property is available only after data binding has occurred. Before data binding occurs, this property returns null. This property is also not applicable when the System.Web.UI.WebControls.DetailsView control is in insert mode and returns null.

Requirements

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0