System.Web.UI.WebControls.DetailsViewRow Class

Represents a row within a System.Web.UI.WebControls.DetailsView control.

See Also: DetailsViewRow Members

Syntax

public class DetailsViewRow : TableRow

Remarks

The System.Web.UI.WebControls.DetailsViewRow class is used to represent an individual row in a System.Web.UI.WebControls.DetailsView control. Each row in the System.Web.UI.WebControls.DetailsView control has a designated row type. The following table lists the row types that are valid for the System.Web.UI.WebControls.DetailsView control.

DataControlRowType.DataRow

A data row in the System.Web.UI.WebControls.DetailsView control.

DataControlRowType.EmptyDataRow

The empty data row in the System.Web.UI.WebControls.DetailsView control. The empty data row is displayed in a System.Web.UI.WebControls.DetailsView control when there are no records to display.

DataControlRowType.Footer

The footer row in the System.Web.UI.WebControls.DetailsView control.

DataControlRowType.Header

The header row in the System.Web.UI.WebControls.DetailsView control.

DataControlRowType.Pager

A pager row in the System.Web.UI.WebControls.DetailsView control.

To determine the row type of a System.Web.UI.WebControls.DetailsViewRow object, use the DetailsViewRow.RowType property. A System.Web.UI.WebControls.DetailsViewRow object also has a state associated with it. The state can be a bitwise combination of the values in the following table.

DataControlRowState.Alternate

The System.Web.UI.WebControls.DetailsViewRow object is an alternate row in the System.Web.UI.WebControls.DetailsView control.

DataControlRowState.Edit

The System.Web.UI.WebControls.DetailsViewRow object is in edit mode.

DataControlRowState.Insert

The System.Web.UI.WebControls.DetailsViewRow object is in insert mode.

DataControlRowState.Normal

The System.Web.UI.WebControls.DetailsViewRow object is in its normal (default) state.

To determine the state of a System.Web.UI.WebControls.DetailsViewRow object, use the DetailsViewRow.RowState property.

The System.Web.UI.WebControls.DetailsView control stores all its data rows in the DetailsView.Rows collection. To determine the index of a System.Web.UI.WebControls.DetailsViewRow object in the DetailsView.Rows collection, use the DetailsViewRow.RowIndex property.

You can access the individual cells of the System.Web.UI.WebControls.DetailsViewRow object by using the TableRow.Cells property. If a cell contains controls, you can retrieve a control from the cell by using the System.Web.UI.Control.Controls collection of the cell. You can also use the System.Web.UI.Control.FindControl(string) method of the cell to find the control, if the control has an System.Web.UI.Control.ID property specified.

To retrieve a field value from a System.Web.UI.WebControls.BoundField field column or an automatically generated field column, use the TableCell.Text property of the cell. To retrieve a field value from other field column types where the field value is bound to a control, first retrieve the control from the appropriate cell and then access the appropriate property of the control.

Note:

It is possible to use a data-binding expression directly in a System.Web.UI.WebControls.TemplateField field column without binding the value to a property of a control. In this case, the field value is automatically placed in a System.Web.UI.DataBoundLiteralControl control. To retrieve the field value, you must first retrieve the System.Web.UI.DataBoundLiteralControl control from the appropriate cell and then use its System.Web.UI.DataBoundLiteralControl.Text property.

For a list of initial property values for an instance of the System.Web.UI.WebControls.DetailsViewRow class, see the DetailsViewRow.#ctor(int, DataControlRowType, DataControlRowState) constructor.

Requirements

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