FormViewRow Class

Represents a row within a FormView control.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

public ref class FormViewRow : public TableRow
public class FormViewRow extends TableRow
public class FormViewRow extends TableRow
Not applicable.

The FormViewRow class is used to represent an individual row in a FormView control. Each row in the FormView control has a designated row type. The following table lists the different row types.

Row type

Description

DataControlRowType.DataRow

The data row in the FormView control.

DataControlRowType.EmptyDataRow

The empty data row in the FormView control. The empty data row is displayed in a FormView control when there are no records to display.

DataControlRowType.Footer

The footer row in the FormView control.

DataControlRowType.Header

The header row in the FormView control.

DataControlRowType.Pager

A pager row in the FormView control.

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

State value

Description

DataControlRowState.Edit

The FormViewRow object is in edit mode.

DataControlRowState.Insert

The FormViewRow object is in insert mode.

DataControlRowState.Normal

The FormViewRow object is in its normal (default) state.

DataControlRowState.Selected

The FormViewRow object is selected.

To determine the state of a FormViewRow object, use the RowState property.

The FormView control displays the contents of its ItemTemplate property in a data row. To access the data row, use the Row property. To determine the index of the current data item in the data source, use the ItemIndex property.

You can access the individual cells of the FormViewRow object by using the Cells property. If a cell contains controls, you can retrieve a control from the cell by using one of the following methods:

  • Use the Controls collection of the cell to retrieve the control at a specific index.

  • Use the FindControl method of the cell to retrieve the control, if the control has its 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 FormViewRow class, see the FormViewRow constructor.

The following example demonstrates how to retrieve an Image control from the FormViewRow object that represents the item row. The Image controls are declared in the edit and item templates.

No code example is currently available or this language may not be supported.

  • AspNetHostingPermission  For operating in a hosted environment. Demand value: LinkDemand; Permission value: Minimal.
  • AspNetHostingPermission  For operating in a hosted environment. Demand value: InheritanceDemand; Permission value: Minimal.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: