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 |
|
Specifies if paging is enabled. Default is |
Alternating-RowStyle |
TableItemStyle |
x |
Derived from the | ||
AutoGenerate-DeleteButton |
Boolean |
x |
x |
|
If |
AutoGenerate-EditButton |
Boolean |
x |
x |
|
If |
AutoGenerate-InsertButton |
Boolean |
x |
x |
|
If |
AutoGenerateRows |
Boolean |
x |
x |
|
If |
BottomPagerRow |
GridViewRow |
x |
Returns ... |
Get Programming ASP.NET, 3rd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.