Export (0) Print
Expand All
Expand Minimize

DataControlRowType Enumeration

Updated: July 2008

Specifies the function of a row in a data control, such as a DetailsView or GridView control.

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

public enum DataControlRowType

Member nameDescription
HeaderA header row of a data control. Header rows cannot be data-bound.
FooterA footer row of a data control. Footer rows cannot be data-bound.
DataRowA data row of a data control. Only DataRow rows can be data-bound.
SeparatorA row separator. Row separators cannot be data-bound.
PagerA row that displays pager buttons or a pager control. Pager rows cannot be data-bound.
EmptyDataRowThe empty row of a data-bound control. The empty row is displayed when the data-bound control has no records to display and the EmptyDataTemplate template is not a null reference (Nothing in Visual Basic).

The DataControlRowType enumeration identifies the function of rows in a data control. It is used by the DetailsView and GridView controls to distinguish between rows that display data and rows that display other user interface (UI) elements, such as a header row, row separator, or pager buttons.

You can use the DataControlRowType enumeration to identify the type of a GridViewRow or DetailsViewRow object when you enumerate through a GridViewRowCollection or DetailsViewRowCollection collection. If you are writing a data control that creates rows, you can use the DataControlRowType enumeration to identify the function of different rows in the control.

The following code example demonstrates how to use the DataControlRowType enumeration to check the type of a row when working with a GridView control. The AuthorsGridView_RowCreated method ensures that the CommandArgument property of a LinkButton control is unique for all the data rows in the GridView control, so that when a row's LinkButton control is clicked, it can be identified correctly.

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

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

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

.NET Framework

Supported in: 3.5, 3.0, 2.0

Date

History

Reason

July 2008

Fixed description for one of the members.

Content bug fix.

Community Additions

ADD
Show:
© 2014 Microsoft