O'Reilly logo

Programming ASP.NET, 3rd Edition by Dan Hurwitz, Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

DetailsView Control: Examining One Record at a Time

Another way to look at your data is one record at a time. ASP.NET offers a control explicitly for this purpose: the DetailsView. This control allows you to edit, delete, and insert records.

The DetailsView control is derived from the BaseDataBoundControl class as is the GridView. As such it shares many of the same properties with GridView. Many of the commonly used properties of the DetailsView control that are not inherited from Control or WebControl are listed in Table 9-8.

Table 9-8. DetailsView properties not inherited from WebControl

Property

Type

Get

Set

Values

Description

AllowPaging

Boolean

x

x

true, false

Specifies if paging is enabled. Default is false.

Alternating-RowStyle

TableItemStyle

x

  

Derived from the WebControls.Style class, the style properties for the alternate rows.

AutoGenerate-DeleteButton

Boolean

x

x

true, false

If true, a Delete button will be automatically added to each data row. The default is false.

AutoGenerate-EditButton

Boolean

x

x

true, false

If true, an Edit button will be automatically added to each data row. The default is false.

AutoGenerate-InsertButton

Boolean

x

x

true, false

If true, an Insert button will be automatically added to each data row. The default is false.

AutoGenerateRows

Boolean

x

x

true, false

If true, the default, automatically generated data-bound fields will be displayed.

BottomPagerRow

GridViewRow

x

  

Returns ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required