Represents a row within a System.Web.UI.WebControls.FormView control.
See Also: FormViewRow Members
The System.Web.UI.WebControls.FormViewRow class is used to represent an individual row in a System.Web.UI.WebControls.FormView control. Each row in the System.Web.UI.WebControls.FormView control has a designated row type. The following table lists the different row types.
DataControlRowType.DataRow |
The data row in the System.Web.UI.WebControls.FormView control. |
DataControlRowType.EmptyDataRow |
The empty data row in the System.Web.UI.WebControls.FormView control. The empty data row is displayed in a System.Web.UI.WebControls.FormView control when there are no records to display. |
DataControlRowType.Footer |
The footer row in the System.Web.UI.WebControls.FormView control. |
DataControlRowType.Header |
The header row in the System.Web.UI.WebControls.FormView control. |
DataControlRowType.Pager |
A pager row in the System.Web.UI.WebControls.FormView control. |
To determine the row type of a System.Web.UI.WebControls.FormViewRow object, use the FormViewRow.RowType property. A System.Web.UI.WebControls.FormViewRow object also has a state associated with it. The state can be a bitwise combination of the values in the following table.
DataControlRowState.Edit |
The System.Web.UI.WebControls.FormViewRow object is in edit mode. |
DataControlRowState.Insert |
The System.Web.UI.WebControls.FormViewRow object is in insert mode. |
DataControlRowState.Normal |
The System.Web.UI.WebControls.FormViewRow object is in its normal (default) state. |
DataControlRowState.Selected |
The System.Web.UI.WebControls.FormViewRow object is selected. |
To determine the state of a System.Web.UI.WebControls.FormViewRow object, use the FormViewRow.RowState property.
The System.Web.UI.WebControls.FormView control displays the contents of its FormView.ItemTemplate property in a data row. To access the data row, use the FormView.Row property. To determine the index of the current data item in the data source, use the FormViewRow.ItemIndex property.
You can access the individual cells of the System.Web.UI.WebControls.FormViewRow object by using the TableRow.Cells property. If a cell contains controls, you can retrieve a control from the cell by using one of the following methods:
Use the System.Web.UI.Control.Controls collection of the cell to retrieve the control at a specific index.
Use the System.Web.UI.Control.FindControl(string) method of the cell to retrieve the control, if the control has its System.Web.UI.Control.ID property set. This is the preferred method to retrieve a control from a cell.
For a list of initial property values for an instance of the System.Web.UI.WebControls.FormViewRow class, see the FormViewRow.#ctor(int, DataControlRowType, DataControlRowState) constructor.