Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
6472 lines (5771 sloc) 469 KB
<Type Name="DetailsView" FullName="System.Web.UI.WebControls.DetailsView">
<TypeSignature Language="C#" Value="public class DetailsView : System.Web.UI.WebControls.CompositeDataBoundControl, System.Web.UI.ICallbackEventHandler, System.Web.UI.IDataItemContainer, System.Web.UI.IPostBackEventHandler, System.Web.UI.WebControls.ICallbackContainer, System.Web.UI.WebControls.IDataBoundItemControl, System.Web.UI.WebControls.IFieldControl, System.Web.UI.WebControls.IPostBackContainer" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit DetailsView extends System.Web.UI.WebControls.CompositeDataBoundControl implements class System.Web.UI.ICallbackEventHandler, class System.Web.UI.IDataItemContainer, class System.Web.UI.INamingContainer, class System.Web.UI.IPostBackEventHandler, class System.Web.UI.WebControls.ICallbackContainer, class System.Web.UI.WebControls.IDataBoundControl, class System.Web.UI.WebControls.IDataBoundItemControl, class System.Web.UI.WebControls.IFieldControl, class System.Web.UI.WebControls.IPostBackContainer" />
<TypeSignature Language="DocId" Value="T:System.Web.UI.WebControls.DetailsView" />
<TypeSignature Language="VB.NET" Value="Public Class DetailsView&#xA;Inherits CompositeDataBoundControl&#xA;Implements ICallbackContainer, ICallbackEventHandler, IDataBoundItemControl, IDataItemContainer, IFieldControl, IPostBackContainer, IPostBackEventHandler" />
<TypeSignature Language="C++ CLI" Value="public ref class DetailsView : System::Web::UI::WebControls::CompositeDataBoundControl, System::Web::UI::ICallbackEventHandler, System::Web::UI::IDataItemContainer, System::Web::UI::IPostBackEventHandler, System::Web::UI::WebControls::ICallbackContainer, System::Web::UI::WebControls::IDataBoundItemControl, System::Web::UI::WebControls::IFieldControl, System::Web::UI::WebControls::IPostBackContainer" />
<TypeSignature Language="F#" Value="type DetailsView = class&#xA; inherit CompositeDataBoundControl&#xA; interface IDataItemContainer&#xA; interface INamingContainer&#xA; interface ICallbackContainer&#xA; interface ICallbackEventHandler&#xA; interface IPostBackEventHandler&#xA; interface IPostBackContainer&#xA; interface IDataBoundItemControl&#xA; interface IDataBoundControl&#xA; interface IFieldControl" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Web.UI.WebControls.CompositeDataBoundControl</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.Web.UI.ICallbackEventHandler</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Web.UI.IDataItemContainer</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Web.UI.INamingContainer</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Web.UI.IPostBackEventHandler</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Web.UI.WebControls.ICallbackContainer</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Web.UI.WebControls.IDataBoundControl</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Web.UI.WebControls.IDataBoundItemControl</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Web.UI.WebControls.IFieldControl</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Web.UI.WebControls.IPostBackContainer</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultEvent("PageIndexChanging")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.ComponentModel.Designer("System.Web.UI.Design.WebControls.DetailsViewDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Web.UI.ControlValueProperty("SelectedValue")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Web.UI.DataKeyProperty("DataKey")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Web.UI.SupportsEventValidation</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Web.UI.ToolboxData("&lt;{0}:DetailsView runat="server" Width="125px" Height="50px"&gt;&lt;/{0}:DetailsView&gt;")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.Designer("System.Web.UI.Design.WebControls.DetailsViewDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Displays the values of a single record from a data source in a table, where each data row represents a field of the record. The <see cref="T:System.Web.UI.WebControls.DetailsView" /> control allows you to edit, delete, and insert records.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
In this topic:
- [Introduction](#introduction)
- [Row Fields](#row_fields)
- [Binding to Data](#binding_to_data)
- [Security](#security)
- [Data Operations](#data_operations)
- [Customizing the User Interface](#customizing_the_user_interface)
- [Events](#events)
- [Accessibility](#Accessibility)
- [Declarative Syntax](#DeclarativeSyntax)
<a name="introduction"></a>
## Introduction
The <xref:System.Web.UI.WebControls.DetailsView> control is used to display a single record from a data source in a table, where each field of the record is displayed in a row of the table. It can be used in combination with a <xref:System.Web.UI.WebControls.GridView> control for master-detail scenarios. The <xref:System.Web.UI.WebControls.DetailsView> control supports the following features:
- Binding to data source controls, such as <xref:System.Web.UI.WebControls.SqlDataSource>.
- Built-in inserting capabilities.
- Built-in updating and deleting capabilities.
- Built-in paging capabilities.
- Programmatic access to the <xref:System.Web.UI.WebControls.DetailsView> object model to dynamically set properties, handle events, and so on.
- Customizable appearance through themes and styles.
<a name="row_fields"></a>
## Row Fields
Each data row in the <xref:System.Web.UI.WebControls.DetailsView> control is created by declaring a field control. Different row field types determine the behavior of the rows in the control. Field controls derive from <xref:System.Web.UI.WebControls.DataControlField>. The following table lists the different row field types that can be used.
|Column field type|Description|
|-----------------------|-----------------|
|<xref:System.Web.UI.WebControls.BoundField>|Displays the value of a field in a data source as text.|
|<xref:System.Web.UI.WebControls.ButtonField>|Displays a command button in the <xref:System.Web.UI.WebControls.DetailsView> control. This allows you to display a row with a custom button control, such as an Add or a Remove button.|
|<xref:System.Web.UI.WebControls.CheckBoxField>|Displays a check box in the <xref:System.Web.UI.WebControls.DetailsView> control. This row field type is commonly used to display fields with a Boolean value.|
|<xref:System.Web.UI.WebControls.CommandField>|Displays built-in command buttons to perform edit, insert, or delete operations in the <xref:System.Web.UI.WebControls.DetailsView> control.|
|<xref:System.Web.UI.WebControls.HyperLinkField>|Displays the value of a field in a data source as a hyperlink. This row field type allows you to bind a second field to the hyperlink's URL.|
|<xref:System.Web.UI.WebControls.ImageField>|Displays an image in the <xref:System.Web.UI.WebControls.DetailsView> control.|
|<xref:System.Web.UI.WebControls.TemplateField>|Displays user-defined content for a row in the <xref:System.Web.UI.WebControls.DetailsView> control according to a specified template. This row field type allows you to create a custom row field.|
By default, the <xref:System.Web.UI.WebControls.DetailsView.AutoGenerateRows%2A> property is set to `true`, which automatically generates a bound row field object for each field of a bindable type in the data source. Valid bindable types are <xref:System.String>, <xref:System.DateTime>, <xref:System.Decimal>, <xref:System.Guid>, and the set of primitive types. Each field is then displayed in a row as text, in the order in which each field appears in the data source.
Automatically generating the rows provides a quick and easy way to display every field in the record. However, to make use of the <xref:System.Web.UI.WebControls.DetailsView> control's advanced capabilities you must explicitly declare the row fields to include in the <xref:System.Web.UI.WebControls.DetailsView> control. To declare the row fields, first set the <xref:System.Web.UI.WebControls.DetailsView.AutoGenerateRows%2A> property to `false`. Next, add opening and closing `<Fields>` tags between the opening and closing tags of the <xref:System.Web.UI.WebControls.DetailsView> control. Finally, list the row fields that you want to include between the opening and closing `<Fields>` tags. The row fields specified are added to the <xref:System.Web.UI.WebControls.DetailsView.Fields%2A> collection in the order listed. The <xref:System.Web.UI.WebControls.DetailsView.Fields%2A> collection allows you to programmatically manage the row fields in the <xref:System.Web.UI.WebControls.DetailsView> control.
> [!NOTE]
> Automatically generated row fields are not added to the <xref:System.Web.UI.WebControls.DetailsView.Fields%2A> collection.
> [!NOTE]
> Explicitly declared row fields can be displayed in combination with automatically generated row fields. When both are used, explicitly declared row fields are rendered first, followed by the automatically generated row fields.
<a name="binding_to_data"></a>
## Binding to Data
The <xref:System.Web.UI.WebControls.DetailsView> control can be bound to a data source control (such as the <xref:System.Web.UI.WebControls.SqlDataSource> control or <xref:System.Web.UI.WebControls.ObjectDataSource> control) or to any data source collection that implements the <xref:System.Collections.IEnumerable?displayProperty=nameWithType> interface, such as <xref:System.Data.DataView?displayProperty=nameWithType>, <xref:System.Collections.ArrayList?displayProperty=nameWithType>, <xref:System.Collections.Generic.List%601?displayProperty=nameWithType>, or other collection types. Use one of the following methods to bind the <xref:System.Web.UI.WebControls.DetailsView> control to the appropriate data source type:
- To bind to a data source control, set the <xref:System.Web.UI.WebControls.DataBoundControl.DataSourceID%2A> property of the <xref:System.Web.UI.WebControls.DetailsView> control to the <xref:System.Web.UI.Control.ID%2A> value of the data source control. The <xref:System.Web.UI.WebControls.DetailsView> control automatically binds to the specified data source control. This is the preferred method to bind to data.
- To bind to a data source that implements the <xref:System.Collections.IEnumerable?displayProperty=nameWithType> interface, programmatically set the <xref:System.Web.UI.WebControls.BaseDataBoundControl.DataSource%2A> property of the <xref:System.Web.UI.WebControls.DetailsView> control to the data source and then call the <xref:System.Web.UI.WebControls.BaseDataBoundControl.DataBind%2A> method.
For more information on data binding, see [Binding to Databases](https://msdn.microsoft.com/library/ab7b2846-975b-4057-a948-45527497c742).
<a name="security"></a>
## Security
This control can be used to display user input, which might include malicious client script. Check any information that is sent from a client for executable script, SQL statements, or other code before displaying it in your application. ASP.NET provides an input request validation feature to block script and HTML in user input. For more information, see [Script Exploits Overview](https://msdn.microsoft.com/library/772c7312-211a-4eb3-8d6e-eec0aa1dcc07). Validation server controls are also provided to assess user input. For more information, see [Validation Server Control Syntax](https://msdn.microsoft.com/library/96d2c59e-693c-4079-9b53-b3ff0d9e9133).
<a name="data_operations"></a>
## Data Operations
The <xref:System.Web.UI.WebControls.DetailsView> control provides built-in capabilities that allow the user to update, delete, insert, and page through items in the control. When the <xref:System.Web.UI.WebControls.DetailsView> control is bound to a data source control, the <xref:System.Web.UI.WebControls.DetailsView> control can take advantage of the data source control's capabilities and provide automatic updating, deleting, inserting, and paging functionality.
> [!NOTE]
> The <xref:System.Web.UI.WebControls.DetailsView> control can provide support for update, delete, insert, and paging operations with other types of data sources; however, you must provide the implementation for these operations in an appropriate event handler. For more information, see <xref:System.Web.UI.WebControls.DetailsView.ItemDeleting>, <xref:System.Web.UI.WebControls.DetailsView.ItemInserting>, and <xref:System.Web.UI.WebControls.DetailsView.ItemUpdating>.
The <xref:System.Web.UI.WebControls.DetailsView> control can automatically add a <xref:System.Web.UI.WebControls.CommandField> row field with an Edit, Delete, or New button by setting the <xref:System.Web.UI.WebControls.DetailsView.AutoGenerateEditButton%2A>, <xref:System.Web.UI.WebControls.DetailsView.AutoGenerateDeleteButton%2A>, or <xref:System.Web.UI.WebControls.DetailsView.AutoGenerateInsertButton%2A> properties to `true`, respectively. Unlike the Delete button (which deletes the selected record immediately), when the Edit or New button is clicked, the <xref:System.Web.UI.WebControls.DetailsView> control goes into edit or insert mode, respectively. In edit mode, the Edit button is replaced with an Update and a Cancel button. Input controls that are appropriate for the field's data type (such as a <xref:System.Web.UI.WebControls.TextBox> or a <xref:System.Web.UI.WebControls.CheckBox> control) are displayed with a field's value for the user to modify. Clicking the Update button updates the record in the data source, while clicking the Cancel button abandons any changes. Likewise, in insert mode, the New button is replaced with an Insert and a Cancel button, and empty input controls are displayed for the user to enter the values for the new record.
> [!NOTE]
> You can also manually define the update, delete, and insert command buttons in a <xref:System.Web.UI.WebControls.ButtonField>, <xref:System.Web.UI.WebControls.CommandField>, or <xref:System.Web.UI.WebControls.TemplateField> row field. The <xref:System.Web.UI.WebControls.DetailsView> control recognizes buttons with the <xref:System.Web.UI.WebControls.Button.CommandName%2A> property set to "Edit", "Update", "Delete", "New", "Insert", or "Cancel"; however, you still must provide the functionality yourself. For more information, see <xref:System.Web.UI.WebControls.DetailsView.ItemDeleting>, <xref:System.Web.UI.WebControls.DetailsView.ItemInserting>, and <xref:System.Web.UI.WebControls.DetailsView.ItemUpdating>.
The <xref:System.Web.UI.WebControls.DetailsView> control provides a paging feature, which allows the user to navigate to other records in the data source. When enabled, page navigation controls are displayed in a pager row. To enable paging, set the <xref:System.Web.UI.WebControls.DetailsView.AllowPaging%2A> property to `true`. The pager row can be customized using the <xref:System.Web.UI.WebControls.DetailsView.PagerStyle%2A> and <xref:System.Web.UI.WebControls.DetailsView.PagerSettings%2A> properties.
<a name="customizing_the_user_interface"></a>
## Customizing the User Interface
You can customize the appearance of the <xref:System.Web.UI.WebControls.DetailsView> control by setting the style properties for different parts of the control. The following table lists the style properties that you can set.
|Style property|Description|
|--------------------|-----------------|
|<xref:System.Web.UI.WebControls.DetailsView.AlternatingRowStyle%2A>|The style settings for the alternating data rows in the <xref:System.Web.UI.WebControls.DetailsView> control. When this property is set, the data rows are displayed in bands, alternating between the <xref:System.Web.UI.WebControls.DetailsView.RowStyle%2A> settings and the <xref:System.Web.UI.WebControls.DetailsView.AlternatingRowStyle%2A> settings.|
|<xref:System.Web.UI.WebControls.DetailsView.CommandRowStyle%2A>|The style settings for the row that contains the built-in command buttons.|
|<xref:System.Web.UI.WebControls.DetailsView.EditRowStyle%2A>|The style settings for the data rows when the <xref:System.Web.UI.WebControls.DetailsView> control is in edit mode.|
|<xref:System.Web.UI.WebControls.DetailsView.EmptyDataRowStyle%2A>|The style settings for the empty data row that are displayed in the <xref:System.Web.UI.WebControls.DetailsView> control when the data source does not contain any records.|
|<xref:System.Web.UI.WebControls.DetailsView.FooterStyle%2A>|The style settings for the footer row.|
|<xref:System.Web.UI.WebControls.DetailsView.HeaderStyle%2A>|The style settings for the header row.|
|<xref:System.Web.UI.WebControls.DetailsView.InsertRowStyle%2A>|The style settings for the data rows when the <xref:System.Web.UI.WebControls.DetailsView> control is in insert mode.|
|<xref:System.Web.UI.WebControls.DetailsView.PagerStyle%2A>|The style settings for the pager row.|
|<xref:System.Web.UI.WebControls.DetailsView.RowStyle%2A>|The style settings for the data rows in the <xref:System.Web.UI.WebControls.DetailsView> control. When the <xref:System.Web.UI.WebControls.DetailsView.AlternatingRowStyle%2A> property is also set, the data rows are displayed alternating between the <xref:System.Web.UI.WebControls.DetailsView.RowStyle%2A> settings and the <xref:System.Web.UI.WebControls.DetailsView.AlternatingRowStyle%2A> settings.|
|<xref:System.Web.UI.WebControls.DetailsView.FieldHeaderStyle%2A>|The style settings for the header column.|
<a name="events"></a>
## Events
The <xref:System.Web.UI.WebControls.DetailsView> control provides several events that you can program against. This allows you to run a custom routine whenever an event occurs. The following table lists the events supported by the <xref:System.Web.UI.WebControls.DetailsView> control. The <xref:System.Web.UI.WebControls.DetailsView> control also inherits these events from its base classes: <xref:System.Web.UI.Control.DataBinding>, <xref:System.Web.UI.WebControls.BaseDataBoundControl.DataBound>, <xref:System.Web.UI.Control.Disposed>, <xref:System.Web.UI.Control.Init>, <xref:System.Web.UI.Control.Load>, <xref:System.Web.UI.Control.PreRender>, and <xref:System.Web.UI.Control.Render%2A>.
|Event|Description|
|-----------|-----------------|
|<xref:System.Web.UI.WebControls.DetailsView.ItemCommand>|Occurs when a button is clicked in the <xref:System.Web.UI.WebControls.DetailsView> control.|
|<xref:System.Web.UI.WebControls.DetailsView.ItemCreated>|Occurs after all <xref:System.Web.UI.WebControls.DetailsViewRow> objects are created in the <xref:System.Web.UI.WebControls.DetailsView> control. This event is often used to modify the values of a record before it is displayed.|
|<xref:System.Web.UI.WebControls.DetailsView.ItemDeleted>|Occurs when a Delete button is clicked, but after the <xref:System.Web.UI.WebControls.DetailsView> control deletes the record from the data source. This event is often used to check the results of the delete operation.|
|<xref:System.Web.UI.WebControls.DetailsView.ItemDeleting>|Occurs when a Delete button is clicked, but before the <xref:System.Web.UI.WebControls.DetailsView> control deletes the record from the data source. This event is often used to cancel the delete operation.|
|<xref:System.Web.UI.WebControls.DetailsView.ItemInserted>|Occurs when an Insert button is clicked, but after the <xref:System.Web.UI.WebControls.DetailsView> control inserts the record. This event is often used to check the results of the insert operation.|
|<xref:System.Web.UI.WebControls.DetailsView.ItemInserting>|Occurs when an Insert button is clicked, but before the <xref:System.Web.UI.WebControls.DetailsView> control inserts the record. This event is often used to cancel the insert operation.|
|<xref:System.Web.UI.WebControls.DetailsView.ItemUpdated>|Occurs when an Update button is clicked, but after the <xref:System.Web.UI.WebControls.DetailsView> control updates the row. This event is often used to check the results of the update operation.|
|<xref:System.Web.UI.WebControls.DetailsView.ItemUpdating>|Occurs when an Update button is clicked, but before the <xref:System.Web.UI.WebControls.DetailsView> control updates the record. This event is often used to cancel the update operation.|
|<xref:System.Web.UI.WebControls.DetailsView.ModeChanged>|Occurs after the <xref:System.Web.UI.WebControls.DetailsView> control changes modes (edit, insert, or read-only mode). This event is often used to perform a task when the <xref:System.Web.UI.WebControls.DetailsView> control changes modes.|
|<xref:System.Web.UI.WebControls.DetailsView.ModeChanging>|Occurs before the <xref:System.Web.UI.WebControls.DetailsView> control changes modes (edit, insert, or read-only mode). This event is often used to cancel a mode change.|
|<xref:System.Web.UI.WebControls.DetailsView.PageIndexChanged>|Occurs when one of the pager buttons is clicked, but after the <xref:System.Web.UI.WebControls.DetailsView> control handles the paging operation. This event is commonly used when you need to perform a task after the user navigates to a different record in the control.|
|<xref:System.Web.UI.WebControls.DetailsView.PageIndexChanging>|Occurs when one of the pager buttons is clicked, but before the <xref:System.Web.UI.WebControls.DetailsView> control handles the paging operation. This event is often used to cancel the paging operation.|
<a name="Accessibility"></a>
## Accessibility
For information about how to configure this control so that it generates markup that conforms to accessibility standards, see [Accessibility in Visual Studio and ASP.NET](https://msdn.microsoft.com/library/7e3ce9c4-6b7d-4fb1-94b5-72cf2a44fe13) and [ASP.NET Controls and Accessibility](https://msdn.microsoft.com/library/847a37e3-ce20-41da-b0d3-7dfb0fdae9a0).
<a name="DeclarativeSyntax"></a>
## Declarative Syntax
```
<asp:DetailsView
    AccessKey="string"
    AllowPaging="True|False"
    AutoGenerateDeleteButton="True|False"
    AutoGenerateEditButton="True|False"
    AutoGenerateInsertButton="True|False"
    AutoGenerateRows="True|False"
    BackColor="color name|#dddddd"
    BackImageUrl="uri"
    BorderColor="color name|#dddddd"
    BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double|Groove|Ridge|
Inset|Outset"
    BorderWidth="size"
    Caption="string"
    CaptionAlign="NotSet|Top|Bottom|Left|Right"
    CellPadding="integer"
    CellSpacing="integer"
    CssClass="string"
    DataKeyNames="string"
    DataMember="string"
    DataSource="string"
    DataSourceID="string"
    DefaultMode="ReadOnly|Edit|Insert"
    EmptyDataText="string"
    Enabled="True|False"
    EnablePagingCallbacks="True|False"
    EnableTheming="True|False"
    EnableViewState="True|False"
    Font-Bold="True|False"
    Font-Italic="True|False"
    Font-Names="string"
    Font-Overline="True|False"
    Font-Size="string|Smaller|Larger|XX-Small|X-Small|Small|Medium|
Large|X-Large|XX-Large"
    Font-Strikeout="True|False"
    Font-Underline="True|False"
    FooterText="string"
    ForeColor="color name|#dddddd"
    GridLines="None|Horizontal|Vertical|Both"
    HeaderText="string"
    Height="size"
    HorizontalAlign="NotSet|Left|Center|Right|Justify"
    ID="string"
    OnDataBinding="DataBinding event handler"
    OnDataBound="DataBound event handler"
    OnDisposed="Disposed event handler"
    OnInit="Init event handler"
    OnItemCommand="ItemCommand event handler"
    OnItemCreated="ItemCreated event handler"
    OnItemDeleted="ItemDeleted event handler"
    OnItemDeleting="ItemDeleting event handler"
    OnItemInserted="ItemInserted event handler"
    OnItemInserting="ItemInserting event handler"
    OnItemUpdated="ItemUpdated event handler"
    OnItemUpdating="ItemUpdating event handler"
    OnLoad="Load event handler"
    OnModeChanged="ModeChanged event handler"
    OnModeChanging="ModeChanging event handler"
    OnPageIndexChanged="PageIndexChanged event handler"
    OnPageIndexChanging="PageIndexChanging event handler"
    OnPreRender="PreRender event handler"
    OnUnload="Unload event handler"
    PageIndex="integer"
    PagerSettings-FirstPageImageUrl="uri"
    PagerSettings-FirstPageText="string"
    PagerSettings-LastPageImageUrl="uri"
    PagerSettings-LastPageText="string"
    PagerSettings-Mode="NextPrevious|Numeric|NextPreviousFirstLast|NumericFirstLast"
    PagerSettings-NextPageImageUrl="uri"
    PagerSettings-NextPageText="string"
    PagerSettings-PageButtonCount="integer"
    PagerSettings-Position="Bottom|Top|TopAndBottom"
    PagerSettings-PreviousPageImageUrl="uri"
    PagerSettings-PreviousPageText="string"
    PagerSettings-Visible="True|False"
    runat="server"
    SkinID="string"
    Style="string"
    TabIndex="integer"
    ToolTip="string"
    Visible="True|False"
    Width="size"
>
        <AlternatingRowStyle />
        <CommandRowStyle />
        <EditRowStyle />
        <EmptyDataRowStyle />
        <EmptyDataTemplate>
<!-- child controls -->
        </EmptyDataTemplate>
        <FieldHeaderStyle />
        <Fields>
                <asp:BoundField
                    AccessibleHeaderText="string"
                    ApplyFormatInEditMode="True|False"
                    ConvertEmptyStringToNull="True|False"
                    DataField="string"
                    DataFormatString="string"
                    FooterText="string"
                    HeaderImageUrl="uri"
                    HeaderText="string"
                    HtmlEncode="True|False"
                    InsertVisible="True|False"
                    NullDisplayText="string"
                    ReadOnly="True|False"
                    ShowHeader="True|False"
                    SortExpression="string"
                    Visible="True|False"
>
                        <ControlStyle />
                        <FooterStyle />
                        <HeaderStyle />
                        <ItemStyle />
                </asp:BoundField>
                <asp:ButtonField
                    AccessibleHeaderText="string"
                    ButtonType="Button|Image|Link"
                    CausesValidation="True|False"
                    CommandName="string"
                    DataTextField="string"
                    DataTextFormatString="string"
                    FooterText="string"
                    HeaderImageUrl="uri"
                    HeaderText="string"
                    ImageUrl="uri"
                    InsertVisible="True|False"
                    ShowHeader="True|False"
                    SortExpression="string"
                    Text="string"
                    ValidationGroup="string"
                    Visible="True|False"
>
                        <ControlStyle />
                        <FooterStyle />
                        <HeaderStyle />
                        <ItemStyle />
                </asp:ButtonField>
                <asp:CheckBoxField
                    AccessibleHeaderText="string"
                    DataField="string"
                    FooterText="string"
                    HeaderImageUrl="uri"
                    HeaderText="string"
                    InsertVisible="True|False"
                    ReadOnly="True|False"
                    ShowHeader="True|False"
                    SortExpression="string"
                    Text="string"
                    Visible="True|False"
>
                        <ControlStyle />
                        <FooterStyle />
                        <HeaderStyle />
                        <ItemStyle />
                </asp:CheckBoxField>
                <asp:CommandField
                    AccessibleHeaderText="string"
                    ButtonType="Button|Image|Link"
                    CancelImageUrl="uri"
                    CancelText="string"
                    CausesValidation="True|False"
                    DeleteImageUrl="uri"
                    DeleteText="string"
                    EditImageUrl="uri"
                    EditText="string"
                    FooterText="string"
                    HeaderImageUrl="uri"
                    HeaderText="string"
                    InsertImageUrl="uri"
                    InsertText="string"
                    InsertVisible="True|False"
                    NewImageUrl="uri"
                    NewText="string"
                    SelectImageUrl="uri"
                    SelectText="string"
                    ShowCancelButton="True|False"
                    ShowDeleteButton="True|False"
                    ShowEditButton="True|False"
                    ShowHeader="True|False"
                    ShowInsertButton="True|False"
                    ShowSelectButton="True|False"
                    SortExpression="string"
                    UpdateImageUrl="uri"
                    UpdateText="string"
                    ValidationGroup="string"
                    Visible="True|False"
>
                        <ControlStyle />
                        <FooterStyle />
                        <HeaderStyle />
                        <ItemStyle />
                </asp:CommandField>
                <asp:DynamicField
                    AccessibleHeaderText="string"
                    ApplyFormatInEditMode="True|False"
                    ConvertEmptyStringToNull="True|False"
                    DataField="string"
                    DataFormatString="string"
                    FooterText="string"
                    HeaderImageUrl="uri"
                    HeaderText="string"
                    HtmlEncode="True|False"
                    InsertVisible="True|False"
                    NullDisplayText="string"
                    ShowHeader="True|False"
                    UIHint="string"
                    Visible="True|False"
>
                        <ControlStyle />
                        <FooterStyle />
                        <HeaderStyle />
                        <ItemStyle />
                </asp:DynamicField>
                <asp:HyperLinkField
                    AccessibleHeaderText="string"
                    DataNavigateUrlFields="string"
                    DataNavigateUrlFormatString="string"
                    DataTextField="string"
                    DataTextFormatString="string"
                    FooterText="string"
                    HeaderImageUrl="uri"
                    HeaderText="string"
                    InsertVisible="True|False"
                    NavigateUrl="uri"
                    ShowHeader="True|False"
                    SortExpression="string"
                    Target="string|_blank|_parent|_search|_self|_top"
                    Text="string"
                    Visible="True|False"
>
                        <ControlStyle />
                        <FooterStyle />
                        <HeaderStyle />
                        <ItemStyle />
                </asp:HyperLinkField>
                <asp:ImageField
                    AccessibleHeaderText="string"
                    AlternateText="string"
                    ConvertEmptyStringToNull="True|False"
                    DataAlternateTextField="string"
                    DataAlternateTextFormatString="string"
                    DataImageUrlField="string"
                    DataImageUrlFormatString="string"
                    FooterText="string"
                    HeaderImageUrl="uri"
                    HeaderText="string"
                    InsertVisible="True|False"
                    NullDisplayText="string"
                    NullImageUrl="uri"
                    ReadOnly="True|False"
                    ShowHeader="True|False"
                    SortExpression="string"
                    Visible="True|False"
>
                        <ControlStyle />
                        <FooterStyle />
                        <HeaderStyle />
                        <ItemStyle />
                </asp:ImageField>
                <asp:TemplateField
                    AccessibleHeaderText="string"
                    ConvertEmptyStringToNull="True|False"
                    FooterText="string"
                    HeaderImageUrl="uri"
                    HeaderText="string"
                    InsertVisible="True|False"
                    ShowHeader="True|False"
                    SortExpression="string"
                    Visible="True|False"
>
                            <ControlStyle />
                            <FooterStyle />
                            <HeaderStyle />
                            <ItemStyle />
                        <AlternatingItemTemplate>
<!-- child controls -->
                        </AlternatingItemTemplate>
                        <EditItemTemplate>
<!-- child controls -->
                        </EditItemTemplate>
                        <FooterTemplate>
<!-- child controls -->
                        </FooterTemplate>
                        <HeaderTemplate>
<!-- child controls -->
                        </HeaderTemplate>
                        <InsertItemTemplate>
<!-- child controls -->
                        </InsertItemTemplate>
                        <ItemTemplate>
<!-- child controls -->
                        </ItemTemplate>
                </asp:TemplateField>
        </Fields>
        <FooterStyle />
        <FooterTemplate>
<!-- child controls -->
        </FooterTemplate>
        <HeaderStyle />
        <HeaderTemplate>
<!-- child controls -->
        </HeaderTemplate>
        <InsertRowStyle />
        <PagerSettings
            FirstPageImageUrl="uri"
            FirstPageText="string"
            LastPageImageUrl="uri"
            LastPageText="string"
            Mode="NextPrevious|Numeric|NextPreviousFirstLast|
NumericFirstLast"
            NextPageImageUrl="uri"
            NextPageText="string"
            OnPropertyChanged="PropertyChanged event handler"
            PageButtonCount="integer"
            Position="Bottom|Top|TopAndBottom"
            PreviousPageImageUrl="uri"
            PreviousPageText="string"
            Visible="True|False"
        />
        <PagerStyle />
        <PagerTemplate>
<!-- child controls -->
        </PagerTemplate>
        <RowStyle        />
</asp:DetailsView>
```
## Examples
The following code example demonstrates how to use to use a <xref:System.Web.UI.WebControls.DetailsView> control in combination with a <xref:System.Web.UI.WebControls.GridView> control for a simple master-detail scenario. It displays the details of an item selected in the <xref:System.Web.UI.WebControls.GridView> control.
[!code-aspx-csharp[DetailsViewSimple#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewSimple/CS/detailsviewsimplecs.aspx#1)]
[!code-aspx-vb[DetailsViewSimple#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewSimple/VB/detailsviewsimplevb.aspx#1)]
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView> control to add, delete, and edit records.
[!code-aspx-csharp[DetailsViewComplex#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewComplex/CS/detailsviewcomplexcs.aspx#1)]
[!code-aspx-vb[DetailsViewComplex#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewComplex/VB/detailsviewcomplexvb.aspx#1)]
The following code example demonstrates how to declaratively add row fields to the <xref:System.Web.UI.WebControls.DetailsView> control.
[!code-aspx-csharp[DetailsViewRowField#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewRowField/CS/detailsviewrowfieldscs.aspx#1)]
[!code-aspx-vb[DetailsViewRowField#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewRowField/VB/detailsviewrowfieldsvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="P:System.Type.IsPrimitive" />
<altmember cref="T:System.Web.UI.WebControls.AccessDataSource" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.AllowPaging" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.AutoGenerateRows" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.AutoGenerateDeleteButton" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.AutoGenerateEditButton" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.AutoGenerateInsertButton" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.Fields" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.Rows" />
<altmember cref="T:System.Web.UI.WebControls.BoundField" />
<altmember cref="T:System.Web.UI.WebControls.ButtonField" />
<altmember cref="T:System.Web.UI.WebControls.CommandField" />
<altmember cref="T:System.Web.UI.WebControls.CheckBoxField" />
<altmember cref="T:System.Web.UI.WebControls.GridView" />
<altmember cref="T:System.Web.UI.WebControls.HyperLinkField" />
<altmember cref="T:System.Web.UI.WebControls.SqlDataSource" />
<altmember cref="T:System.Web.UI.WebControls.TemplateField" />
<related type="Article" href="https://msdn.microsoft.com/library/88622d04-2989-484e-93fe-594cd98dcf5f(v=vs.100)">Using Parameters with Data Source Controls</related>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public DetailsView ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.DetailsView.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; DetailsView();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Web.UI.WebControls.DetailsView" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use this constructor to initialize a new instance of the <xref:System.Web.UI.WebControls.DetailsView> class. To dynamically add a <xref:System.Web.UI.WebControls.DetailsView> control to a page, create a new <xref:System.Web.UI.WebControls.DetailsView> object, set its properties, and then add it to the <xref:System.Web.UI.Control.Controls%2A?displayProperty=nameWithType> collection of a container control, such as <xref:System.Web.UI.WebControls.PlaceHolder>.
## Examples
The following code example demonstrates how to use the constructor to dynamically add a <xref:System.Web.UI.WebControls.DetailsView> control to a page.
[!code-aspx-csharp[DetailsViewCtor#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewCtor/CS/detailsviewctorcs.aspx#1)]
[!code-aspx-vb[DetailsViewCtor#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewCtor/VB/detailsviewctorvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.Control.Controls" />
<altmember cref="T:System.Web.UI.WebControls.PlaceHolder" />
</Docs>
</Member>
<Member MemberName="AllowPaging">
<MemberSignature Language="C#" Value="public virtual bool AllowPaging { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool AllowPaging" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.AllowPaging" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property AllowPaging As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property bool AllowPaging { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.AllowPaging : bool with get, set" Usage="System.Web.UI.WebControls.DetailsView.AllowPaging" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the paging feature is enabled.</summary>
<value>
<see langword="true" /> to enable the paging feature; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.DetailsView> control has built-in paging capabilities, which allow a user to navigate to a different record in the data source.
The <xref:System.Web.UI.WebControls.DetailsView> control can perform both user interface (UI) and data source paging. The UI paging feature can be used with any data source object that supports the <xref:System.Collections.ICollection?displayProperty=nameWithType> interface. For each paging operation, the <xref:System.Web.UI.WebControls.DetailsView> control queries the data source for the entire data collection and selects the row to display, essentially discarding the remaining data.
If a data source implements <xref:System.Web.UI.DataSourceView> and the <xref:System.Web.UI.DataSourceView.CanPage%2A> property returns `true`, the <xref:System.Web.UI.WebControls.DetailsView> control will use data source paging instead of UI paging. In this case, the <xref:System.Web.UI.WebControls.DetailsView> control will query for only the row needed for each paging operation. Thus, data source paging is more efficient than UI paging. Only the <xref:System.Web.UI.WebControls.ObjectDataSourceView> object supports data source paging without modification.
To enable the paging feature, set the <xref:System.Web.UI.WebControls.DetailsView.AllowPaging%2A> property to `true`. You can determine the total number of items in the underlying data source by using the <xref:System.Web.UI.WebControls.DetailsView.PageCount%2A> property. To determine the index of the currently displayed item, use the <xref:System.Web.UI.WebControls.DetailsView.PageIndex%2A> property.
When paging is enabled, an additional row called the pager row is automatically displayed in the <xref:System.Web.UI.WebControls.DetailsView> control. The pager row contains the page navigation controls and can be displayed at the top, bottom, or both the top and bottom of the control. The pager row has two built-in pager display modes: numbered pages and next and previous page links (default). The numbered pages mode displays links for the individual pages, allowing the user to navigate to a specific page. The next and previous links mode displays controls that allow the user to navigate to the next or the previous page.
> [!NOTE]
> The <xref:System.Web.UI.WebControls.DetailsView> control automatically hides the pager row when the data source contains fewer than two records.
You can control the settings of the pager row (such as the pager display mode, the number of page links to display at a time, and the pager control's text label) by using the <xref:System.Web.UI.WebControls.DetailsView.PagerSettings%2A> property. To control the appearance of the pager row (including its background color, font color, and position), use the <xref:System.Web.UI.WebControls.DetailsView.PagerStyle%2A> property. The <xref:System.Web.UI.WebControls.DetailsView> control also allows you to define a custom template for the pager row. For more information on creating a custom pager row template, see <xref:System.Web.UI.WebControls.DetailsView.PagerTemplate%2A>.
The <xref:System.Web.UI.WebControls.DetailsView> control provides several events that you can use to perform a custom action when paging occurs. The following table lists the available events.
|Event|Description|
|-----------|-----------------|
|<xref:System.Web.UI.WebControls.DetailsView.PageIndexChanged>|Occurs when one of the pager buttons is clicked, but after the <xref:System.Web.UI.WebControls.DetailsView> control handles the paging operation. This event is commonly used when you need to perform a task after the user navigates to a different record in the control.|
|<xref:System.Web.UI.WebControls.DetailsView.PageIndexChanging>|Occurs when one of the pager buttons is clicked, but before the <xref:System.Web.UI.WebControls.DetailsView> control handles the paging operation. This event is often used to cancel the paging operation.|
The value of <xref:System.Web.UI.WebControls.DetailsView.AllowPaging%2A> is stored in view state.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.AllowPaging%2A> property to enable the paging capabilities of the <xref:System.Web.UI.WebControls.DetailsView> control.
[!code-aspx-csharp[DetailsViewAllowPaging#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewAllowPaging/CS/detailsviewallowpagingcs.aspx#1)]
[!code-aspx-vb[DetailsViewAllowPaging#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewAllowPaging/VB/detailsviewallowpagingvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.DetailsView.BottomPagerRow" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.PageCount" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.PageIndex" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.PagerSettings" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.PagerStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.TopPagerRow" />
<altmember cref="E:System.Web.UI.WebControls.DetailsView.PageIndexChanged" />
<altmember cref="E:System.Web.UI.WebControls.DetailsView.PageIndexChanging" />
</Docs>
</Member>
<Member MemberName="AlternatingRowStyle">
<MemberSignature Language="C#" Value="public System.Web.UI.WebControls.TableItemStyle AlternatingRowStyle { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.WebControls.TableItemStyle AlternatingRowStyle" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.AlternatingRowStyle" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property AlternatingRowStyle As TableItemStyle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Web::UI::WebControls::TableItemStyle ^ AlternatingRowStyle { System::Web::UI::WebControls::TableItemStyle ^ get(); };" />
<MemberSignature Language="F#" Value="member this.AlternatingRowStyle : System.Web.UI.WebControls.TableItemStyle" Usage="System.Web.UI.WebControls.DetailsView.AlternatingRowStyle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(null)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.NotifyParentProperty(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.TableItemStyle</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a reference to the <see cref="T:System.Web.UI.WebControls.TableItemStyle" /> object that allows you to set the appearance of the alternating data rows in a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</summary>
<value>A reference to the <see cref="T:System.Web.UI.WebControls.TableItemStyle" /> that represents the style of alternating data rows in a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.DetailsView.AlternatingRowStyle%2A> property to control the appearance of alternating data rows in a <xref:System.Web.UI.WebControls.DetailsView> control. When this property is set, the data rows are displayed alternating between the <xref:System.Web.UI.WebControls.DetailsView.RowStyle%2A> settings and the <xref:System.Web.UI.WebControls.DetailsView.AlternatingRowStyle%2A> settings. This property is read-only; however, you can set the properties of the <xref:System.Web.UI.WebControls.TableItemStyle> object it returns. The properties can be set declaratively in the form `Property-Subproperty`, where `Subproperty` is a property of the <xref:System.Web.UI.WebControls.TableItemStyle> object (for example, `AlternatingRowStyle-ForeColor`). The properties can also be set programmatically in the form `Property.Subproperty` (for example, `AlternatingRowStyle.ForeColor`). Common settings usually include a custom background color, foreground color, and font properties.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.AlternatingRowStyle%2A> property to specify the font and style settings for the alternating data rows in the <xref:System.Web.UI.WebControls.DetailsView> control.
[!code-aspx-csharp[DetailsViewRowStyle#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewRowStyle/CS/detailsviewrowstylecs.aspx#1)]
[!code-aspx-vb[DetailsViewRowStyle#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewRowStyle/VB/detailsviewrowstylevb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TableItemStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.CommandRowStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.EditRowStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.EmptyDataRowStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.FooterStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.FieldHeaderStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.HeaderStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.InsertRowStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.RowStyle" />
</Docs>
</Member>
<Member MemberName="AutoGenerateDeleteButton">
<MemberSignature Language="C#" Value="public virtual bool AutoGenerateDeleteButton { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool AutoGenerateDeleteButton" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.AutoGenerateDeleteButton" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property AutoGenerateDeleteButton As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property bool AutoGenerateDeleteButton { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.AutoGenerateDeleteButton : bool with get, set" Usage="System.Web.UI.WebControls.DetailsView.AutoGenerateDeleteButton" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the built-in control to delete the current record is displayed in a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</summary>
<value>
<see langword="true" /> to display the built-in control to delete the current record; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When a <xref:System.Web.UI.WebControls.DetailsView> control is bound to an object that inherits from <xref:System.Web.UI.DataSourceView> and the <xref:System.Web.UI.DataSourceView.CanDelete%2A> property returns `true`, the <xref:System.Web.UI.WebControls.DetailsView> control can take advantage of the data source control's capabilities and provide automatic deleting functionality.
> [!NOTE]
> For a <xref:System.Web.UI.WebControls.SqlDataSourceView> object to delete data, the <xref:System.Web.UI.WebControls.SqlDataSource.DeleteCommand%2A?displayProperty=nameWithType> property of the underlying <xref:System.Web.UI.WebControls.SqlDataSource> object must be set with a delete query statement.
When the <xref:System.Web.UI.WebControls.DetailsView.AutoGenerateDeleteButton%2A> property is set to `true`, a <xref:System.Web.UI.WebControls.CommandField> row field with a Delete button is automatically displayed in the <xref:System.Web.UI.WebControls.DetailsView> control. Clicking the Delete button permanently removes that record from the data source.
> [!NOTE]
> You must also set the <xref:System.Web.UI.WebControls.DetailsView.DataKeyNames%2A> property for the automatic deletion feature to work.
The <xref:System.Web.UI.WebControls.DetailsView> control provides several events that you can use to perform a custom action when a record is deleted. The following table lists the available events.
|Event|Description|
|-----------|-----------------|
|<xref:System.Web.UI.WebControls.DetailsView.ItemDeleted>|Occurs when the Delete button is clicked, but after the <xref:System.Web.UI.WebControls.DetailsView> control deletes the record from the data source. This event is often used to check the results of the delete operation.|
|<xref:System.Web.UI.WebControls.DetailsView.ItemDeleting>|Occurs when the Delete button is clicked, but before the <xref:System.Web.UI.WebControls.DetailsView> control deletes the record from the data source. This event is often used to cancel the delete operation.|
The value of <xref:System.Web.UI.WebControls.DetailsView.AutoGenerateDeleteButton%2A> is stored in view state.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.AutoGenerateDeleteButton%2A> property to display the built-in control to delete the current record.
[!code-aspx-csharp[DetailsViewAutoGenerateDeleteButton#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewAutoGenerateDeleteButton/CS/detailsviewautogeneratedeletebuttoncs.aspx#1)]
[!code-aspx-vb[DetailsViewAutoGenerateDeleteButton#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewAutoGenerateDeleteButton/VB/detailsviewautogeneratedeletebuttonvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.CommandField" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.AutoGenerateEditButton" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.AutoGenerateInsertButton" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.DataKeyNames" />
<altmember cref="E:System.Web.UI.WebControls.DetailsView.ItemDeleted" />
<altmember cref="E:System.Web.UI.WebControls.DetailsView.ItemDeleting" />
<altmember cref="P:System.Web.UI.WebControls.SqlDataSource.DeleteCommand" />
</Docs>
</Member>
<Member MemberName="AutoGenerateEditButton">
<MemberSignature Language="C#" Value="public virtual bool AutoGenerateEditButton { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool AutoGenerateEditButton" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.AutoGenerateEditButton" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property AutoGenerateEditButton As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property bool AutoGenerateEditButton { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.AutoGenerateEditButton : bool with get, set" Usage="System.Web.UI.WebControls.DetailsView.AutoGenerateEditButton" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the built-in controls to edit the current record are displayed in a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</summary>
<value>
<see langword="true" /> to display the built-in controls to edit the current record; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When a data source control that supports updating is bound to a <xref:System.Web.UI.WebControls.DetailsView> control, the <xref:System.Web.UI.WebControls.DetailsView> control can take advantage of the data source control's capabilities and provide automatic updating functionality.
> [!NOTE]
> For a data source control to update data, its <xref:System.Web.UI.WebControls.SqlDataSource.UpdateCommand%2A?displayProperty=nameWithType> property must be set with an update query statement.
When the <xref:System.Web.UI.WebControls.DetailsView.AutoGenerateEditButton%2A> property is set to `true`, a <xref:System.Web.UI.WebControls.CommandField> row field with an Edit button is automatically displayed in the <xref:System.Web.UI.WebControls.DetailsView> control. Clicking the Edit button puts that <xref:System.Web.UI.WebControls.DetailsView> control in edit mode. When in edit mode, each bound field in the control that is not read-only displays the appropriate input control, such as a <xref:System.Web.UI.WebControls.TextBox> control, for the field's data type. This allows the user to modify the field's value.
When clicked, the Edit button is also replaced with an Update button and a Cancel button. Clicking the Update button updates the record in the data source with any value changes and returns the control to the mode specified by the <xref:System.Web.UI.WebControls.DetailsView.DefaultMode%2A> property. Clicking the Cancel button abandons any value changes and returns the control to the default mode.
> [!NOTE]
> To put a <xref:System.Web.UI.WebControls.DetailsView> control in edit mode programmatically, use the <xref:System.Web.UI.WebControls.DetailsView.ChangeMode%2A> method.
When the <xref:System.Web.UI.WebControls.DetailsView.AutoGenerateRows%2A> property is also set to `true`, the <xref:System.Web.UI.WebControls.DetailsView> control automatically ensures that the field or fields specified in the <xref:System.Web.UI.WebControls.DetailsView.DataKeyNames%2A> property are read-only.
> [!NOTE]
> Unless you implement your own updating functionality, you must set the <xref:System.Web.UI.WebControls.DetailsView.DataKeyNames%2A> property for the automatic updating feature to work.
You can control the appearance of the data rows when the <xref:System.Web.UI.WebControls.DetailsView> control is in edit mode by using the <xref:System.Web.UI.WebControls.DetailsView.EditRowStyle%2A> property. Common settings usually include a custom background color, foreground color, and font properties.
The <xref:System.Web.UI.WebControls.DetailsView> control provides several events that you can use to perform a custom action when a record is updated. The following table lists the available events.
|Event|Description|
|-----------|-----------------|
|<xref:System.Web.UI.WebControls.DetailsView.ItemUpdated>|Occurs when the Update button is clicked, but after the <xref:System.Web.UI.WebControls.DetailsView> control updates the record. This event is often used to check the results of the update operation.|
|<xref:System.Web.UI.WebControls.DetailsView.ItemUpdating>|Occurs when the Update button is clicked, but before the <xref:System.Web.UI.WebControls.DetailsView> control updates the record. This event is often used to cancel the update operation.|
|<xref:System.Web.UI.WebControls.DetailsView.ModeChanged>|Occurs after the <xref:System.Web.UI.WebControls.DetailsView> control changes modes.|
|<xref:System.Web.UI.WebControls.DetailsView.ModeChanging>|Occurs before the <xref:System.Web.UI.WebControls.DetailsView> control changes modes. This event is often used to cancel the mode change.|
The value of <xref:System.Web.UI.WebControls.DetailsView.AutoGenerateEditButton%2A> is stored in view state.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.AutoGenerateEditButton%2A> property to display the built-in controls to edit the current record.
[!code-aspx-csharp[DetailsViewAutoGenerateEditButton#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewAutoGenerateEditButton/CS/detailsviewautogenerateeditbuttoncs.aspx#1)]
[!code-aspx-vb[DetailsViewAutoGenerateEditButton#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewAutoGenerateEditButton/VB/detailsviewautogenerateeditbuttonvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.CommandField" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.AutoGenerateDeleteButton" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.AutoGenerateInsertButton" />
<altmember cref="M:System.Web.UI.WebControls.DetailsView.ChangeMode(System.Web.UI.WebControls.DetailsViewMode)" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.DataKey" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.DataKeyNames" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.DefaultMode" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.EditRowStyle" />
<altmember cref="E:System.Web.UI.WebControls.DetailsView.ItemUpdated" />
<altmember cref="E:System.Web.UI.WebControls.DetailsView.ItemUpdating" />
<altmember cref="E:System.Web.UI.WebControls.DetailsView.ModeChanged" />
<altmember cref="E:System.Web.UI.WebControls.DetailsView.ModeChanging" />
<altmember cref="P:System.Web.UI.WebControls.SqlDataSource.UpdateCommand" />
</Docs>
</Member>
<Member MemberName="AutoGenerateInsertButton">
<MemberSignature Language="C#" Value="public virtual bool AutoGenerateInsertButton { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool AutoGenerateInsertButton" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.AutoGenerateInsertButton" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property AutoGenerateInsertButton As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property bool AutoGenerateInsertButton { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.AutoGenerateInsertButton : bool with get, set" Usage="System.Web.UI.WebControls.DetailsView.AutoGenerateInsertButton" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether the built-in controls to insert a new record are displayed in a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</summary>
<value>
<see langword="true" /> to display the built-in controls to insert a new record; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When a data source control that supports inserting is bound to a <xref:System.Web.UI.WebControls.DetailsView> control, the <xref:System.Web.UI.WebControls.DetailsView> control can take advantage of the data source control's capabilities and provide automatic inserting functionality.
> [!NOTE]
> For a data source control to insert data, its <xref:System.Web.UI.WebControls.SqlDataSource.InsertCommand%2A?displayProperty=nameWithType> property must be set with an insert query statement.
When the <xref:System.Web.UI.WebControls.DetailsView.AutoGenerateInsertButton%2A> property is set to `true`, a <xref:System.Web.UI.WebControls.CommandField> row field with a New button is automatically displayed in the <xref:System.Web.UI.WebControls.DetailsView> control. Clicking the New button puts that <xref:System.Web.UI.WebControls.DetailsView> control in insert mode. When in insert mode, each bound field in the control that is not read-only displays the appropriate input control, such as a <xref:System.Web.UI.WebControls.TextBox> control, for the field's data type. This allows the user to enter the field's value for the new record.
When clicked, the New button is also replaced with an Insert button and a Cancel button. Clicking the Insert button inserts the new record in the data source and returns the control to the mode specified by the <xref:System.Web.UI.WebControls.DetailsView.DefaultMode%2A> property. Clicking the Cancel button abandons the insert operation and returns the control to the default mode.
> [!NOTE]
> To put a row in insert mode programmatically, use the <xref:System.Web.UI.WebControls.DetailsView.ChangeMode%2A> method.
You can control the appearance of a record that is in insert mode by using the <xref:System.Web.UI.WebControls.DetailsView.InsertRowStyle%2A> property. Common settings usually include a custom background color, foreground color, and font properties.
The <xref:System.Web.UI.WebControls.DetailsView> control provides several events that you can use to perform a custom action when a new record is inserted. The following table lists the available events.
|Event|Description|
|-----------|-----------------|
|<xref:System.Web.UI.WebControls.DetailsView.ItemInserted>|Occurs when the Insert button is clicked, but after the <xref:System.Web.UI.WebControls.DetailsView> control inserts the record. This event is often used to check the results of the insert operation.|
|<xref:System.Web.UI.WebControls.DetailsView.ItemInserting>|Occurs when the Insert button is clicked, but before the <xref:System.Web.UI.WebControls.DetailsView> control inserts the record. This event is often used to cancel the insert operation.|
|<xref:System.Web.UI.WebControls.DetailsView.ModeChanged>|Occurs after the <xref:System.Web.UI.WebControls.DetailsView> control changes modes.|
|<xref:System.Web.UI.WebControls.DetailsView.ModeChanging>|Occurs before the <xref:System.Web.UI.WebControls.DetailsView> control changes modes. This event is often used to cancel the mode change.|
The value of <xref:System.Web.UI.WebControls.DetailsView.AutoGenerateInsertButton%2A> is stored in view state.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.AutoGenerateInsertButton%2A> property to display the built-in controls to insert a new record in a <xref:System.Web.UI.WebControls.DetailsView> control.
[!code-aspx-csharp[DetailsViewAutoGenerateInsertButton#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewAutoGenerateInsertButton/CS/detailsviewautogenerateinsertbuttoncs.aspx#1)]
[!code-aspx-vb[DetailsViewAutoGenerateInsertButton#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewAutoGenerateInsertButton/VB/detailsviewautogenerateinsertbuttonvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.CommandField" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.AutoGenerateDeleteButton" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.AutoGenerateEditButton" />
<altmember cref="M:System.Web.UI.WebControls.DetailsView.ChangeMode(System.Web.UI.WebControls.DetailsViewMode)" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.DataKey" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.DataKeyNames" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.DefaultMode" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.InsertRowStyle" />
<altmember cref="E:System.Web.UI.WebControls.DetailsView.ItemInserted" />
<altmember cref="E:System.Web.UI.WebControls.DetailsView.ItemInserting" />
<altmember cref="E:System.Web.UI.WebControls.DetailsView.ModeChanged" />
<altmember cref="E:System.Web.UI.WebControls.DetailsView.ModeChanging" />
<altmember cref="P:System.Web.UI.WebControls.SqlDataSource.UpdateCommand" />
</Docs>
</Member>
<Member MemberName="AutoGenerateRows">
<MemberSignature Language="C#" Value="public virtual bool AutoGenerateRows { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool AutoGenerateRows" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.AutoGenerateRows" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property AutoGenerateRows As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property bool AutoGenerateRows { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.AutoGenerateRows : bool with get, set" Usage="System.Web.UI.WebControls.DetailsView.AutoGenerateRows" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether row fields for each field in the data source are automatically generated and displayed in a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</summary>
<value>
<see langword="true" /> to display automatically generated bound row fields for each field in the data source; otherwise, <see langword="false" />. The default is <see langword="true" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Each data row in the <xref:System.Web.UI.WebControls.DetailsView> control is represented by a row field. When the <xref:System.Web.UI.WebControls.DetailsView.AutoGenerateRows%2A> property is set to `true`, an automatically generated bound row field is created for each field in the data source. Each field is then displayed in a row as text, in the order in which each field appears in the data source.
> [!NOTE]
> Automatically generated bound row fields are not added to the <xref:System.Web.UI.WebControls.DetailsView.Fields%2A> collection.
Automatically generating the rows provides a quick and easy way to display every field in the record. However, to make use of the <xref:System.Web.UI.WebControls.DetailsView> control's advanced capabilities you must explicitly declare the row fields to include in the <xref:System.Web.UI.WebControls.DetailsView> control. For more information, see <xref:System.Web.UI.WebControls.DetailsView.Fields%2A>.
> [!NOTE]
> Explicitly declared row fields can be used in combination with automatically generated row fields. When both are used, explicitly declared row fields are rendered first, followed by the automatically generated row fields.
The value of <xref:System.Web.UI.WebControls.DetailsView.AutoGenerateRows%2A> is stored in view state.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.AutoGenerateRows%2A> property to automatically create bound row fields for each field in the data source.
[!code-aspx-csharp[DetailsViewAutoGenerateRows#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewAutoGenerateRows/CS/detailsviewautogeneraterowscs.aspx#1)]
[!code-aspx-vb[DetailsViewAutoGenerateRows#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewAutoGenerateRows/VB/detailsviewautogeneraterowsvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.AutoGeneratedField" />
<altmember cref="T:System.Web.UI.WebControls.BoundField" />
<altmember cref="T:System.Web.UI.WebControls.ButtonField" />
<altmember cref="T:System.Web.UI.WebControls.CommandField" />
<altmember cref="T:System.Web.UI.WebControls.CheckBoxField" />
<altmember cref="T:System.Web.UI.WebControls.HyperLinkField" />
<altmember cref="T:System.Web.UI.WebControls.TemplateField" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.Fields" />
</Docs>
</Member>
<Member MemberName="BackImageUrl">
<MemberSignature Language="C#" Value="public virtual string BackImageUrl { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string BackImageUrl" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.BackImageUrl" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property BackImageUrl As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::String ^ BackImageUrl { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.BackImageUrl : string with get, set" Usage="System.Web.UI.WebControls.DetailsView.BackImageUrl" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue("")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.ComponentModel.Editor("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Web.UI.UrlProperty</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.Editor("System.Web.UI.Design.ImageUrlEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the URL to an image to display in the background of a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</summary>
<value>The URL to an image to display in the background of the <see cref="T:System.Web.UI.WebControls.DetailsView" /> control. The default is an empty string (""), which indicates that this property is not set.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.DetailsView.BackImageUrl%2A> property to specify the URL to an image to display in the background of a <xref:System.Web.UI.WebControls.DetailsView> control.
> [!NOTE]
> If the specified image is smaller than the <xref:System.Web.UI.WebControls.DetailsView> control, the image is tiled to fill in the background. If the image is larger than the control, the image is cropped.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.BackImageUrl%2A> property to display a custom image in the background of a <xref:System.Web.UI.WebControls.DetailsView> control. You must provide your own image for this example to work.
[!code-aspx-csharp[DetailsViewBackImageUrl#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewBackImageUrl/CS/detailsviewbackimageurlcs.aspx#1)]
[!code-aspx-vb[DetailsViewBackImageUrl#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewBackImageUrl/VB/detailsviewbackimageurlvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.DetailsView.CellPadding" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.CellSpacing" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.GridLines" />
</Docs>
</Member>
<Member MemberName="BottomPagerRow">
<MemberSignature Language="C#" Value="public virtual System.Web.UI.WebControls.DetailsViewRow BottomPagerRow { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.WebControls.DetailsViewRow BottomPagerRow" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.BottomPagerRow" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property BottomPagerRow As DetailsViewRow" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Web::UI::WebControls::DetailsViewRow ^ BottomPagerRow { System::Web::UI::WebControls::DetailsViewRow ^ get(); };" />
<MemberSignature Language="F#" Value="member this.BottomPagerRow : System.Web.UI.WebControls.DetailsViewRow" Usage="System.Web.UI.WebControls.DetailsView.BottomPagerRow" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.DetailsViewRow</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a <see cref="T:System.Web.UI.WebControls.DetailsViewRow" /> object that represents the bottom pager row in a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</summary>
<value>A <see cref="T:System.Web.UI.WebControls.DetailsViewRow" /> that represents the bottom pager row in the <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When paging is enabled (by setting the <xref:System.Web.UI.WebControls.DetailsView.AllowPaging%2A> property to `true`), an additional row called the pager row is automatically displayed in the <xref:System.Web.UI.WebControls.DetailsView> control. The pager row contains controls that allow the user to navigate to other records, and can be displayed at the top, the bottom, or both the top and bottom of the control. Use the <xref:System.Web.UI.WebControls.DetailsView.BottomPagerRow%2A> property to programmatically access the <xref:System.Web.UI.WebControls.DetailsViewRow> object that represents the bottom pager row in the <xref:System.Web.UI.WebControls.DetailsView> control.
> [!NOTE]
> The <xref:System.Web.UI.WebControls.DetailsView.BottomPagerRow%2A> property is available only after the <xref:System.Web.UI.WebControls.DetailsView> control creates the bottom pager row in the <xref:System.Web.UI.WebControls.DetailsView.ItemCreated> event.
This property is commonly used when you need to programmatically manipulate the bottom pager row, for example when adding custom content. Any modification to the <xref:System.Web.UI.WebControls.DetailsView.BottomPagerRow%2A> property must be performed after the <xref:System.Web.UI.WebControls.DetailsView> control has been rendered; otherwise, the <xref:System.Web.UI.WebControls.DetailsView> control will overwrite any changes.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.BottomPagerRow%2A> property to access the bottom pager row of the <xref:System.Web.UI.WebControls.DetailsView> control during the <xref:System.Web.UI.WebControls.DetailsView.ItemCreated> event. Two <xref:System.Web.UI.WebControls.Label> controls within the custom pager row are then updated with the current page number and total number of pages.
[!code-aspx-csharp[DetailsViewPagerTemplate#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewPagerTemplate/CS/detailsviewpagertemplatecs.aspx#1)]
[!code-aspx-vb[DetailsViewPagerTemplate#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewPagerTemplate/VB/detailsviewpagertemplatevb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.DetailsViewRow" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.AllowPaging" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.TopPagerRow" />
<altmember cref="E:System.Web.UI.WebControls.DetailsView.ItemCreated" />
</Docs>
</Member>
<Member MemberName="Caption">
<MemberSignature Language="C#" Value="public virtual string Caption { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Caption" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.Caption" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property Caption As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::String ^ Caption { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.Caption : string with get, set" Usage="System.Web.UI.WebControls.DetailsView.Caption" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue("")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the text to render in an HTML caption element in a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control. This property is provided to make the control more accessible to users of assistive technology devices.</summary>
<value>A string that represents the text to render in an HTML caption element in a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control. The default value is an empty string ("").</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.DetailsView.Caption%2A> property to specify the text to render in an HTML caption element in a <xref:System.Web.UI.WebControls.DetailsView> control. The text that you specify provides assistive technology devices with a description of the table that can be used to make the control more accessible.
Additional accessibility support for the <xref:System.Web.UI.WebControls.DetailsView> control is provided by the <xref:System.Web.UI.WebControls.DetailsView.CaptionAlign%2A> property. Use the <xref:System.Web.UI.WebControls.DetailsView.CaptionAlign%2A> property to specify the alignment of the HTML caption element in a <xref:System.Web.UI.WebControls.DetailsView> control.
The value of <xref:System.Web.UI.WebControls.DetailsView.Caption%2A> is stored in view state.
The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see <xref:System.ComponentModel.LocalizableAttribute> and [Globalization and Localization](https://msdn.microsoft.com/library/8ef3838e-9d05-4236-9dd0-ceecff9df80d).
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.Caption%2A> property to specify the text for the HTML caption element rendered in a <xref:System.Web.UI.WebControls.DetailsView> control.
[!code-aspx-csharp[DetailsViewCaption#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewCaption/CS/detailsviewcaptioncs.aspx#1)]
[!code-aspx-vb[DetailsViewCaption#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewCaption/VB/detailsviewcaptionvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.DetailsView.CaptionAlign" />
</Docs>
</Member>
<Member MemberName="CaptionAlign">
<MemberSignature Language="C#" Value="public virtual System.Web.UI.WebControls.TableCaptionAlign CaptionAlign { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Web.UI.WebControls.TableCaptionAlign CaptionAlign" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.CaptionAlign" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property CaptionAlign As TableCaptionAlign" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Web::UI::WebControls::TableCaptionAlign CaptionAlign { System::Web::UI::WebControls::TableCaptionAlign get(); void set(System::Web::UI::WebControls::TableCaptionAlign value); };" />
<MemberSignature Language="F#" Value="member this.CaptionAlign : System.Web.UI.WebControls.TableCaptionAlign with get, set" Usage="System.Web.UI.WebControls.DetailsView.CaptionAlign" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(Mono.Cecil.CustomAttributeArgument)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.TableCaptionAlign</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the horizontal or vertical position of the HTML caption element in a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control. This property is provided to make the control more accessible to users of assistive technology devices.</summary>
<value>One of the <see cref="T:System.Web.UI.WebControls.TableCaptionAlign" /> values. The default is <see langword="TableCaptionAlign.NotSet" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.DetailsView.CaptionAlign%2A> property to specify the horizontal or vertical position of the HTML caption element in a <xref:System.Web.UI.WebControls.DetailsView> control. This property is provided to make the control more accessible to users of assistive technology devices.
This property is set using one of the <xref:System.Web.UI.WebControls.TableCaptionAlign> enumeration values. The following table lists the possible values.
|Value|Description|
|-----------|-----------------|
|`TableCaptionAlign.Bottom`|The caption element is aligned with the bottom of the table.|
|`TableCaptionAlign.Left`|The caption element is aligned with the left side of the table.|
|`TableCaptionAlign.NotSet`|The caption element's alignment is not set.|
|`TableCaptionAlign.Right`|The caption element is aligned with the right side of the table.|
|`TableCaptionAlign.Top`|The caption element is aligned with the top of the table.|
Additional accessibility support for the <xref:System.Web.UI.WebControls.DetailsView> control is provided by the <xref:System.Web.UI.WebControls.DetailsView.Caption%2A> property. Use the <xref:System.Web.UI.WebControls.DetailsView.Caption%2A> property to specify the text to render in an HTML caption element in a <xref:System.Web.UI.WebControls.DetailsView> control.
The value of <xref:System.Web.UI.WebControls.DetailsView.CaptionAlign%2A> is stored in view state.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.CaptionAlign%2A> property to specify that the HTML caption element in a <xref:System.Web.UI.WebControls.DetailsView> control should be rendered on the left side of the control.
[!code-aspx-csharp[DetailsViewCaption#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewCaption/CS/detailsviewcaptioncs.aspx#1)]
[!code-aspx-vb[DetailsViewCaption#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewCaption/VB/detailsviewcaptionvb.aspx#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The specified value is not one of the <see cref="T:System.Web.UI.WebControls.TableCaptionAlign" /> enumeration values.</exception>
<altmember cref="T:System.Web.UI.WebControls.TableCaptionAlign" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.Caption" />
</Docs>
</Member>
<Member MemberName="CellPadding">
<MemberSignature Language="C#" Value="public virtual int CellPadding { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 CellPadding" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.CellPadding" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property CellPadding As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property int CellPadding { int get(); void set(int value); };" />
<MemberSignature Language="F#" Value="member this.CellPadding : int with get, set" Usage="System.Web.UI.WebControls.DetailsView.CellPadding" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(-1)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the amount of space between the contents of a cell and the cell's border.</summary>
<value>The amount of space, in pixels, between the contents of a cell and the cell's border. The default value is -1, which indicates that this property is not set.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.DetailsView.CellPadding%2A> property to control the spacing between the contents of a cell and the cell's border. The padding amount specified is added to all four sides of the cell.
All cells in the same column of a <xref:System.Web.UI.WebControls.DetailsView> control have the same width. The padding amount is applied to the widest cell and all other cells in the column are adjusted to that cell width. Similarly, all cells in the same row have the same height. The padding amount is applied to the tallest cell in the row and all other cells in the row are adjusted to that cell height. Individual cell sizes cannot be specified.
To adjust the spacing between cells, use the <xref:System.Web.UI.WebControls.DetailsView.CellSpacing%2A> property.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.CellPadding%2A> property to specify the amount of spacing between the contents of a cell and the cell's border.
[!code-aspx-csharp[DetailsViewCellPadding#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewCellPadding/CS/detailsviewcellpaddingcs.aspx#1)]
[!code-aspx-vb[DetailsViewCellPadding#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewCellPadding/VB/detailsviewcellpaddingvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.DetailsView.CellSpacing" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.GridLines" />
</Docs>
</Member>
<Member MemberName="CellSpacing">
<MemberSignature Language="C#" Value="public virtual int CellSpacing { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 CellSpacing" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.CellSpacing" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property CellSpacing As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property int CellSpacing { int get(); void set(int value); };" />
<MemberSignature Language="F#" Value="member this.CellSpacing : int with get, set" Usage="System.Web.UI.WebControls.DetailsView.CellSpacing" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(0)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the amount of space between cells.</summary>
<value>The amount of space, in pixels, between cells. The default value is 0.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.DetailsView.CellSpacing%2A> property to control the spacing between adjacent cells in the <xref:System.Web.UI.WebControls.DetailsView> control. This spacing is applied both vertically and horizontally. The cell spacing is uniform for the entire control. Individual cell spacing between rows or columns cannot be specified.
> [!NOTE]
> If you set this property to a value greater than 0, and then set the <xref:System.Web.UI.WebControls.DetailsView.GridLines%2A> property to a value that displays the cell borders, a gap is displayed between the borders of adjacent cells. In this situation, the <xref:System.Web.UI.WebControls.DetailsView.CellSpacing%2A> property controls the size of the gap.
To adjust the spacing between the contents of a cell and the cell's border, use the <xref:System.Web.UI.WebControls.DetailsView.CellPadding%2A> property.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.CellSpacing%2A> property to specify the amount of spacing between adjacent cells.
[!code-aspx-csharp[DetailsViewCellPadding#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewCellPadding/CS/detailsviewcellpaddingcs.aspx#1)]
[!code-aspx-vb[DetailsViewCellPadding#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewCellPadding/VB/detailsviewcellpaddingvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.DetailsView.CellPadding" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.GridLines" />
</Docs>
</Member>
<Member MemberName="ChangeMode">
<MemberSignature Language="C#" Value="public void ChangeMode (System.Web.UI.WebControls.DetailsViewMode newMode);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void ChangeMode(valuetype System.Web.UI.WebControls.DetailsViewMode newMode) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.DetailsView.ChangeMode(System.Web.UI.WebControls.DetailsViewMode)" />
<MemberSignature Language="VB.NET" Value="Public Sub ChangeMode (newMode As DetailsViewMode)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void ChangeMode(System::Web::UI::WebControls::DetailsViewMode newMode);" />
<MemberSignature Language="F#" Value="member this.ChangeMode : System.Web.UI.WebControls.DetailsViewMode -&gt; unit" Usage="detailsView.ChangeMode newMode" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="newMode" Type="System.Web.UI.WebControls.DetailsViewMode" />
</Parameters>
<Docs>
<param name="newMode">One of the <see cref="T:System.Web.UI.WebControls.DetailsViewMode" /> values.</param>
<summary>Switches the <see cref="T:System.Web.UI.WebControls.DetailsView" /> control to the specified mode.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.DetailsView.ChangeMode%2A> method to programmatically switch the <xref:System.Web.UI.WebControls.DetailsView> control between edit, insert, and read-only mode. This method also updates the <xref:System.Web.UI.WebControls.DetailsView.CurrentMode%2A> property with the specified mode. The following table lists the different mode values.
|Mode|Description|
|----------|-----------------|
|`DetailsViewMode.Edit`|The <xref:System.Web.UI.WebControls.DetailsView> control is in edit mode, which allows the user to update the values of a record.|
|`DetailsViewMode.Insert`|The <xref:System.Web.UI.WebControls.DetailsView> control is in insert mode, which allows the user to add a new record to the data source.|
|`DetailsView.ReadOnly`|The <xref:System.Web.UI.WebControls.DetailsView> control is in read-only mode, which is the normal display mode.|
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.ChangeMode%2A> method to return the <xref:System.Web.UI.WebControls.DetailsView> control to read-only mode whenever the user navigates to another record.
[!code-aspx-csharp[DetailsViewChangeMode#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewChangeMode/CS/detailsviewchangemodecs.aspx#1)]
[!code-aspx-vb[DetailsViewChangeMode#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewChangeMode/VB/detailsviewchangemodevb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.DetailsViewMode" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.CurrentMode" />
</Docs>
</Member>
<Member MemberName="CommandRowStyle">
<MemberSignature Language="C#" Value="public System.Web.UI.WebControls.TableItemStyle CommandRowStyle { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.WebControls.TableItemStyle CommandRowStyle" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.CommandRowStyle" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property CommandRowStyle As TableItemStyle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Web::UI::WebControls::TableItemStyle ^ CommandRowStyle { System::Web::UI::WebControls::TableItemStyle ^ get(); };" />
<MemberSignature Language="F#" Value="member this.CommandRowStyle : System.Web.UI.WebControls.TableItemStyle" Usage="System.Web.UI.WebControls.DetailsView.CommandRowStyle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(null)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.NotifyParentProperty(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.TableItemStyle</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a reference to the <see cref="T:System.Web.UI.WebControls.TableItemStyle" /> object that allows you to set the appearance of a command row in a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</summary>
<value>A reference to the <see cref="T:System.Web.UI.WebControls.TableItemStyle" /> that represents the style of a command row in a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.DetailsView.CommandRowStyle%2A> property to control the appearance of a command row in a <xref:System.Web.UI.WebControls.DetailsView> control. A command row contains the command buttons to perform operations such as editing, deleting, and inserting. This property is read-only; however, you can set the properties of the <xref:System.Web.UI.WebControls.TableItemStyle> object it returns. The properties can be set declaratively in the form `Property-Subproperty`, where `Subproperty` is a property of the <xref:System.Web.UI.WebControls.TableItemStyle> object (for example, `CommandRowStyle-ForeColor`). The properties can also be set programmatically in the form `Property.Subproperty` (for example, `CommandRowStyle.ForeColor`). Common settings usually include a custom background color, foreground color, and font properties.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.CommandRowStyle%2A> property to specify the font and style settings for the command row in the <xref:System.Web.UI.WebControls.DetailsView> control.
[!code-aspx-csharp[DetailsViewCommandRowStyle#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewCommandRowStyle/CS/detailsviewcommandrowstylecs.aspx#1)]
[!code-aspx-vb[DetailsViewCommandRowStyle#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewCommandRowStyle/VB/detailsviewcommandrowstylevb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TableItemStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.AlternatingRowStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.EditRowStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.EmptyDataRowStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.FooterStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.FieldHeaderStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.HeaderStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.InsertRowStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.RowStyle" />
</Docs>
</Member>
<Member MemberName="CreateAutoGeneratedRow">
<MemberSignature Language="C#" Value="protected virtual System.Web.UI.WebControls.AutoGeneratedField CreateAutoGeneratedRow (System.Web.UI.WebControls.AutoGeneratedFieldProperties fieldProperties);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance class System.Web.UI.WebControls.AutoGeneratedField CreateAutoGeneratedRow(class System.Web.UI.WebControls.AutoGeneratedFieldProperties fieldProperties) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.DetailsView.CreateAutoGeneratedRow(System.Web.UI.WebControls.AutoGeneratedFieldProperties)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function CreateAutoGeneratedRow (fieldProperties As AutoGeneratedFieldProperties) As AutoGeneratedField" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Web::UI::WebControls::AutoGeneratedField ^ CreateAutoGeneratedRow(System::Web::UI::WebControls::AutoGeneratedFieldProperties ^ fieldProperties);" />
<MemberSignature Language="F#" Value="abstract member CreateAutoGeneratedRow : System.Web.UI.WebControls.AutoGeneratedFieldProperties -&gt; System.Web.UI.WebControls.AutoGeneratedField&#xA;override this.CreateAutoGeneratedRow : System.Web.UI.WebControls.AutoGeneratedFieldProperties -&gt; System.Web.UI.WebControls.AutoGeneratedField" Usage="detailsView.CreateAutoGeneratedRow fieldProperties" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.AutoGeneratedField</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="fieldProperties" Type="System.Web.UI.WebControls.AutoGeneratedFieldProperties" />
</Parameters>
<Docs>
<param name="fieldProperties">An <see cref="T:System.Web.UI.WebControls.AutoGeneratedFieldProperties" /> that contains the properties for the <see cref="T:System.Web.UI.WebControls.AutoGeneratedField" />.</param>
<summary>Creates an <see cref="T:System.Web.UI.WebControls.AutoGeneratedField" /> object that represents an automatically generated row field using the specified field properties.</summary>
<returns>An <see cref="T:System.Web.UI.WebControls.AutoGeneratedField" /> that contains the field properties specified by the <paramref name="fieldProperties" /> parameter.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.DetailsView.CreateAutoGeneratedRow%2A> method is a helper method called by the <xref:System.Web.UI.WebControls.DetailsView> control to create an automatically generated row field using the specified field properties.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When extending the <see cref="T:System.Web.UI.WebControls.DetailsView" /> class, you can override this method to create your own automatically generated row field.</para>
</block>
<altmember cref="T:System.Web.UI.WebControls.AutoGeneratedFieldProperties" />
</Docs>
</Member>
<Member MemberName="CreateAutoGeneratedRows">
<MemberSignature Language="C#" Value="protected virtual System.Collections.ICollection CreateAutoGeneratedRows (object dataItem);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance class System.Collections.ICollection CreateAutoGeneratedRows(object dataItem) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.DetailsView.CreateAutoGeneratedRows(System.Object)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function CreateAutoGeneratedRows (dataItem As Object) As ICollection" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Collections::ICollection ^ CreateAutoGeneratedRows(System::Object ^ dataItem);" />
<MemberSignature Language="F#" Value="abstract member CreateAutoGeneratedRows : obj -&gt; System.Collections.ICollection&#xA;override this.CreateAutoGeneratedRows : obj -&gt; System.Collections.ICollection" Usage="detailsView.CreateAutoGeneratedRows dataItem" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Collections.ICollection</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="dataItem" Type="System.Object" />
</Parameters>
<Docs>
<param name="dataItem">The data item for which to create the automatically generated row fields.</param>
<summary>Creates a set of automatically generated row fields for the specified data item.</summary>
<returns>An <see cref="T:System.Collections.ICollection" /> that contains the automatically generated row fields for the specified data item.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When the <xref:System.Web.UI.WebControls.DetailsView.AutoGenerateRows%2A> property is set to `true`, the <xref:System.Web.UI.WebControls.DetailsView.CreateAutoGeneratedRows%2A> method is called by the <xref:System.Web.UI.WebControls.DetailsView> control to create a set of automatically generated row fields for the current data item.
]]></format>
</remarks>
<exception cref="T:System.Web.HttpException">The <see cref="T:System.Web.UI.WebControls.DetailsView" /> control does not have any properties or attributes from which to generate fields.</exception>
<block subset="none" type="overrides">
<para>When extending the <see cref="T:System.Web.UI.WebControls.DetailsView" /> class, you can override this method to create your own set of automatically generated row fields.</para>
</block>
<altmember cref="P:System.Web.UI.WebControls.DetailsView.AutoGenerateRows" />
<altmember cref="M:System.Web.UI.WebControls.DetailsView.CreateAutoGeneratedRows(System.Object)" />
</Docs>
</Member>
<Member MemberName="CreateChildControls">
<MemberSignature Language="C#" Value="protected override int CreateChildControls (System.Collections.IEnumerable dataSource, bool dataBinding);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance int32 CreateChildControls(class System.Collections.IEnumerable dataSource, bool dataBinding) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.DetailsView.CreateChildControls(System.Collections.IEnumerable,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Function CreateChildControls (dataSource As IEnumerable, dataBinding As Boolean) As Integer" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override int CreateChildControls(System::Collections::IEnumerable ^ dataSource, bool dataBinding);" />
<MemberSignature Language="F#" Value="override this.CreateChildControls : System.Collections.IEnumerable * bool -&gt; int" Usage="detailsView.CreateChildControls (dataSource, dataBinding)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="dataSource" Type="System.Collections.IEnumerable" />
<Parameter Name="dataBinding" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="dataSource">An <see cref="T:System.Collections.IEnumerable" /> that represents the data source for the <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</param>
<param name="dataBinding">
<see langword="true" /> to indicate that this method is being called during data binding; otherwise, <see langword="false" />.</param>
<summary>Creates the control hierarchy used to render the <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</summary>
<returns>The number of items in the data source.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.DetailsView.CreateChildControls%2A> method is a helper method called by the <xref:System.Web.UI.WebControls.DetailsView> control to create the control hierarchy for the control.
]]></format>
</remarks>
<exception cref="T:System.Web.HttpException">
<paramref name="dataSource" /> returns a null <see cref="T:System.Web.UI.DataSourceView" />.
-or-
<paramref name="dataSource" /> is not an <see cref="T:System.Collections.ICollection" /> and cannot return a total row count.
-or-
<paramref name="dataBinding" /> is <see langword="false" /> and <paramref name="dataSource" /> does not implement the <see cref="T:System.Collections.ICollection" /> interface.
-or-
<paramref name="dataSource" /> does not implement the <see cref="T:System.Collections.ICollection" /> interface and <see cref="P:System.Web.UI.WebControls.DetailsView.AllowPaging" /> is set to <see langword="true" />.</exception>
<block subset="none" type="overrides">
<para>When extending the <see cref="T:System.Web.UI.WebControls.DetailsView" /> class, you can override this method to create your own control hierarchy.</para>
</block>
<altmember cref="T:System.Collections.IEnumerable" />
</Docs>
</Member>
<Member MemberName="CreateControlStyle">
<MemberSignature Language="C#" Value="protected override System.Web.UI.WebControls.Style CreateControlStyle ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance class System.Web.UI.WebControls.Style CreateControlStyle() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.DetailsView.CreateControlStyle" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Function CreateControlStyle () As Style" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override System::Web::UI::WebControls::Style ^ CreateControlStyle();" />
<MemberSignature Language="F#" Value="override this.CreateControlStyle : unit -&gt; System.Web.UI.WebControls.Style" Usage="detailsView.CreateControlStyle " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.Style</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates a default table style object for the <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</summary>
<returns>A <see cref="T:System.Web.UI.WebControls.Style" /> that contains the default table style for the <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.DetailsView.CreateControlStyle%2A> method is a helper method called by the <xref:System.Web.UI.WebControls.DetailsView> control to create its default table style object. In addition to the default style setting of a <xref:System.Web.UI.WebControls.TableStyle> object, this method also sets the properties in the following table.
|Property|Initial value|
|--------------|-------------------|
|<xref:System.Web.UI.WebControls.TableStyle.GridLines%2A>|`GridLines.Both`|
|<xref:System.Web.UI.WebControls.TableStyle.CellSpacing%2A>|0|
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When extending the <see cref="T:System.Web.UI.WebControls.DetailsView" /> class, you can override this method to return a <see cref="T:System.Web.UI.WebControls.TableStyle" /> object with custom settings.</para>
</block>
<altmember cref="T:System.Web.UI.WebControls.Style" />
<altmember cref="T:System.Web.UI.WebControls.TableStyle" />
</Docs>
</Member>
<Member MemberName="CreateDataSourceSelectArguments">
<MemberSignature Language="C#" Value="protected override System.Web.UI.DataSourceSelectArguments CreateDataSourceSelectArguments ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance class System.Web.UI.DataSourceSelectArguments CreateDataSourceSelectArguments() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.DetailsView.CreateDataSourceSelectArguments" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Function CreateDataSourceSelectArguments () As DataSourceSelectArguments" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override System::Web::UI::DataSourceSelectArguments ^ CreateDataSourceSelectArguments();" />
<MemberSignature Language="F#" Value="override this.CreateDataSourceSelectArguments : unit -&gt; System.Web.UI.DataSourceSelectArguments" Usage="detailsView.CreateDataSourceSelectArguments " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.UI.DataSourceSelectArguments</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates the <see cref="T:System.Web.UI.DataSourceSelectArguments" /> object that gets passed to the Select command.</summary>
<returns>The <see cref="T:System.Web.UI.DataSourceSelectArguments" /> that gets passed to the Select command</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.DetailsView.CreateDataSourceSelectArguments%2A> method is a helper method called by the <xref:System.Web.UI.WebControls.DetailsView> control to create the <xref:System.Web.UI.DataSourceSelectArguments> object that gets passed to the Select command.
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.DataSourceSelectArguments" />
<altmember cref="M:System.Web.UI.WebControls.DataBoundControl.CreateDataSourceSelectArguments" />
</Docs>
</Member>
<Member MemberName="CreateFieldSet">
<MemberSignature Language="C#" Value="protected virtual System.Collections.ICollection CreateFieldSet (object dataItem, bool useDataSource);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance class System.Collections.ICollection CreateFieldSet(object dataItem, bool useDataSource) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.DetailsView.CreateFieldSet(System.Object,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function CreateFieldSet (dataItem As Object, useDataSource As Boolean) As ICollection" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Collections::ICollection ^ CreateFieldSet(System::Object ^ dataItem, bool useDataSource);" />
<MemberSignature Language="F#" Value="abstract member CreateFieldSet : obj * bool -&gt; System.Collections.ICollection&#xA;override this.CreateFieldSet : obj * bool -&gt; System.Collections.ICollection" Usage="detailsView.CreateFieldSet (dataItem, useDataSource)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Collections.ICollection</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="dataItem" Type="System.Object" />
<Parameter Name="useDataSource" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="dataItem">The data item for which to create the row fields.</param>
<param name="useDataSource">
<see langword="true" /> to use the data item to create the automatically generated row fields; otherwise, <see langword="false" />.</param>
<summary>Creates the complete set of automatically generated and user-defined row fields used to generate the control hierarchy.</summary>
<returns>An <see cref="T:System.Collections.ICollection" /> that contains both the automatically generated and the user-defined row fields for the specified data item.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.DetailsView.CreateFieldSet%2A> method is a helper method called by the <xref:System.Web.UI.WebControls.DetailsView> control to create the complete set of row fields for the control. If the <xref:System.Web.UI.WebControls.DetailsView.AutoGenerateRows%2A> property is set to `true`, automatically generated row fields are appended to the user-defined row fields contained in the <xref:System.Web.UI.WebControls.DetailsView.Fields%2A> collection. To create the automatically generated row fields based on the data item, pass in `true` for the `useDataSource` parameter; otherwise, the automatically generated row fields are created based on properties of the existing row fields in the control.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When extending the <see cref="T:System.Web.UI.WebControls.DetailsView" /> class, you can override this method to create your own set of row fields.</para>
</block>
<altmember cref="M:System.Web.UI.WebControls.DetailsView.CreateAutoGeneratedRows(System.Object)" />
</Docs>
</Member>
<Member MemberName="CreateRow">
<MemberSignature Language="C#" Value="protected virtual System.Web.UI.WebControls.DetailsViewRow CreateRow (int rowIndex, System.Web.UI.WebControls.DataControlRowType rowType, System.Web.UI.WebControls.DataControlRowState rowState);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance class System.Web.UI.WebControls.DetailsViewRow CreateRow(int32 rowIndex, valuetype System.Web.UI.WebControls.DataControlRowType rowType, valuetype System.Web.UI.WebControls.DataControlRowState rowState) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.DetailsView.CreateRow(System.Int32,System.Web.UI.WebControls.DataControlRowType,System.Web.UI.WebControls.DataControlRowState)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function CreateRow (rowIndex As Integer, rowType As DataControlRowType, rowState As DataControlRowState) As DetailsViewRow" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Web::UI::WebControls::DetailsViewRow ^ CreateRow(int rowIndex, System::Web::UI::WebControls::DataControlRowType rowType, System::Web::UI::WebControls::DataControlRowState rowState);" />
<MemberSignature Language="F#" Value="abstract member CreateRow : int * System.Web.UI.WebControls.DataControlRowType * System.Web.UI.WebControls.DataControlRowState -&gt; System.Web.UI.WebControls.DetailsViewRow&#xA;override this.CreateRow : int * System.Web.UI.WebControls.DataControlRowType * System.Web.UI.WebControls.DataControlRowState -&gt; System.Web.UI.WebControls.DetailsViewRow" Usage="detailsView.CreateRow (rowIndex, rowType, rowState)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.DetailsViewRow</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="rowIndex" Type="System.Int32" />
<Parameter Name="rowType" Type="System.Web.UI.WebControls.DataControlRowType" />
<Parameter Name="rowState" Type="System.Web.UI.WebControls.DataControlRowState" />
</Parameters>
<Docs>
<param name="rowIndex">The zero-based index of the data item to display.</param>
<param name="rowType">One of the <see cref="T:System.Web.UI.WebControls.DataControlRowType" /> values.</param>
<param name="rowState">One of the <see cref="T:System.Web.UI.WebControls.DataControlRowState" /> values.</param>
<summary>Creates a <see cref="T:System.Web.UI.WebControls.DetailsViewRow" /> object using the specified item index, row type, and row state.</summary>
<returns>A <see cref="T:System.Web.UI.WebControls.DetailsViewRow" /> with the specified item index, row type, and row state.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.DetailsView.CreateRow%2A> method is a helper method called by the <xref:System.Web.UI.WebControls.DetailsView> control to create a <xref:System.Web.UI.WebControls.DetailsViewRow> object.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When extending the <see cref="T:System.Web.UI.WebControls.DetailsView" /> class, you can override this method to return a <see cref="T:System.Web.UI.WebControls.DetailsViewRow" /> object with custom settings.</para>
</block>
<altmember cref="T:System.Web.UI.WebControls.DetailsViewRow" />
<altmember cref="T:System.Web.UI.WebControls.DataControlRowType" />
<altmember cref="T:System.Web.UI.WebControls.DataControlRowState" />
</Docs>
</Member>
<Member MemberName="CreateTable">
<MemberSignature Language="C#" Value="protected virtual System.Web.UI.WebControls.Table CreateTable ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance class System.Web.UI.WebControls.Table CreateTable() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.DetailsView.CreateTable" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function CreateTable () As Table" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Web::UI::WebControls::Table ^ CreateTable();" />
<MemberSignature Language="F#" Value="abstract member CreateTable : unit -&gt; System.Web.UI.WebControls.Table&#xA;override this.CreateTable : unit -&gt; System.Web.UI.WebControls.Table" Usage="detailsView.CreateTable " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.Table</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates the containing table for the <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</summary>
<returns>A <see cref="T:System.Web.UI.WebControls.Table" /> that represents the containing table for the <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.DetailsView.CreateTable%2A> method is a helper method called by the <xref:System.Web.UI.WebControls.DetailsView> control to create a table that acts as the container for the control.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="CurrentMode">
<MemberSignature Language="C#" Value="public System.Web.UI.WebControls.DetailsViewMode CurrentMode { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Web.UI.WebControls.DetailsViewMode CurrentMode" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.CurrentMode" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property CurrentMode As DetailsViewMode" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Web::UI::WebControls::DetailsViewMode CurrentMode { System::Web::UI::WebControls::DetailsViewMode get(); };" />
<MemberSignature Language="F#" Value="member this.CurrentMode : System.Web.UI.WebControls.DetailsViewMode" Usage="System.Web.UI.WebControls.DetailsView.CurrentMode" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.DetailsViewMode</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the current data-entry mode of the <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</summary>
<value>One of the <see cref="T:System.Web.UI.WebControls.DetailsViewMode" /> values.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.DetailsView.CurrentMode%2A> property to determine whether the <xref:System.Web.UI.WebControls.DetailsView> control is in edit, insert, or read-only mode. The following table lists the different mode values.
|Mode|Description|
|----------|-----------------|
|`DetailsViewMode.Edit`|The <xref:System.Web.UI.WebControls.DetailsView> control is in edit mode, which allows the user to update the values of a record.|
|`DetailsViewMode.Insert`|The <xref:System.Web.UI.WebControls.DetailsView> control is in insert mode, which allows the user to add a new record to the data source.|
|`DetailsViewMode.ReadOnly`|The <xref:System.Web.UI.WebControls.DetailsView> control is in read-only mode, which is the normal display mode.|
This value is normally set automatically by the <xref:System.Web.UI.WebControls.DetailsView> control by when the New, Update, Insert, Delete, or Cancel command button is clicked. You can also programmatically change the mode by using the <xref:System.Web.UI.WebControls.DetailsView.ChangeMode%2A> method.
When the <xref:System.Web.UI.WebControls.DetailsView> control changes modes, the events in the following table are raised. This allows you to create a custom event handler that performs a routine when the event occurs.
|Event|Description|
|-----------|-----------------|
|<xref:System.Web.UI.WebControls.DetailsView.ModeChanged>|Occurs when a command button that changes the mode of the <xref:System.Web.UI.WebControls.DetailsView> control is clicked, but after the mode changes.|
|<xref:System.Web.UI.WebControls.DetailsView.ModeChanging>|Occurs when a command button that changes the mode of the <xref:System.Web.UI.WebControls.DetailsView> control is clicked, but before the mode changes.|
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.CurrentMode%2A> property to determine whether the <xref:System.Web.UI.WebControls.DetailsView> control is in edit, insert, or read-only mode. If the user attempts to navigate to a different record while the <xref:System.Web.UI.WebControls.DetailsView> control is in edit mode, the paging operation is canceled.
[!code-aspx-csharp[DetailsViewCurrentMode#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewCurrentMode/CS/detailsviewcurrentmodecs.aspx#1)]
[!code-aspx-vb[DetailsViewCurrentMode#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewCurrentMode/VB/detailsviewcurrentmodevb.aspx#1)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.DetailsView.CurrentMode" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.DefaultMode" />
<altmember cref="M:System.Web.UI.WebControls.DetailsView.ChangeMode(System.Web.UI.WebControls.DetailsViewMode)" />
<altmember cref="E:System.Web.UI.WebControls.DetailsView.ModeChanged" />
<altmember cref="E:System.Web.UI.WebControls.DetailsView.ModeChanging" />
</Docs>
</Member>
<Member MemberName="DataBind">
<MemberSignature Language="C#" Value="public override sealed void DataBind ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void DataBind() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.DetailsView.DataBind" />
<MemberSignature Language="VB.NET" Value="Public Overrides NotOverridable Sub DataBind ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override void DataBind();" />
<MemberSignature Language="F#" Value="override this.DataBind : unit -&gt; unit" Usage="detailsView.DataBind " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Calls the <see cref="M:System.Web.UI.WebControls.BaseDataBoundControl.DataBind" /> method of the base class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Data-bound controls should override <xref:System.Web.UI.WebControls.DetailsView.PerformDataBinding%2A> instead of <xref:System.Web.UI.WebControls.DetailsView.DataBind%2A>.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="DataItem">
<MemberSignature Language="C#" Value="public virtual object DataItem { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance object DataItem" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.DataItem" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property DataItem As Object" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Object ^ DataItem { System::Object ^ get(); };" />
<MemberSignature Language="F#" Value="member this.DataItem : obj" Usage="System.Web.UI.WebControls.DetailsView.DataItem" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Web.UI.IDataItemContainer.DataItem</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Object</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the data item bound to the <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</summary>
<value>An <see cref="T:System.Object" /> that represents the data item bound to the <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.DetailsView.DataItem%2A> property to access the data item bound to the <xref:System.Web.UI.WebControls.DetailsView> control. The data item is often used to access the field values of the current record directly. The type of the <xref:System.Object> returned by this property varies depending on the data source. For example, when a <xref:System.Web.UI.WebControls.SqlDataSource> control is bound to the <xref:System.Web.UI.WebControls.DetailsView> control, a <xref:System.Data.DataRowView> object is returned.
> [!NOTE]
> This property is available only after data binding has occurred. Before data binding occurs, this property returns `null`. This property is also not applicable when the <xref:System.Web.UI.WebControls.DetailsView> control is in insert mode and returns `null`.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.DataItem%2A> property to determine the value of a field in the data item.
[!code-aspx-csharp[DetailsViewDataItem#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewDataItem/CS/DetailsViewDataItem.aspx#1)]
[!code-aspx-vb[DetailsViewDataItem#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewDataItem/VB/DetailsViewDataItemVB.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Object" />
<altmember cref="Overload:System.Web.UI.DataBinder.Eval" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.DataItemCount" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.DataItemIndex" />
</Docs>
</Member>
<Member MemberName="DataItemCount">
<MemberSignature Language="C#" Value="public int DataItemCount { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 DataItemCount" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.DataItemCount" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property DataItemCount As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property int DataItemCount { int get(); };" />
<MemberSignature Language="F#" Value="member this.DataItemCount : int" Usage="System.Web.UI.WebControls.DetailsView.DataItemCount" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the number of items in the underlying data source.</summary>
<value>The number of items in the underlying data source.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When the paging feature is enabled (by setting the <xref:System.Web.UI.WebControls.DetailsView.AllowPaging%2A> property to `true`), use the <xref:System.Web.UI.WebControls.DetailsView.DataItemCount%2A> property to determine the total number of records in the underlying data source.
> [!NOTE]
> Because the <xref:System.Web.UI.WebControls.DetailsView> control displays only one record at a time, this value also corresponds to the total number of pages required to display every record in the data source.
To determine the index of the current record from the underlying data source, use the <xref:System.Web.UI.WebControls.DetailsView.DataItemIndex%2A> property.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.DataItemCount%2A> property to determine the number of items in the data source. This value is used to display the page count in a <xref:System.Web.UI.WebControls.Label> control contained within a custom pager row.
[!code-aspx-csharp[DetailsViewPagerTemplate#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewPagerTemplate/CS/detailsviewpagertemplatecs.aspx#1)]
[!code-aspx-vb[DetailsViewPagerTemplate#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewPagerTemplate/VB/detailsviewpagertemplatevb.aspx#1)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.DetailsView.AllowPaging" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.DataItemIndex" />
</Docs>
</Member>
<Member MemberName="DataItemIndex">
<MemberSignature Language="C#" Value="public virtual int DataItemIndex { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 DataItemIndex" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.DataItemIndex" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property DataItemIndex As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property int DataItemIndex { int get(); };" />
<MemberSignature Language="F#" Value="member this.DataItemIndex : int" Usage="System.Web.UI.WebControls.DetailsView.DataItemIndex" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Web.UI.IDataItemContainer.DataItemIndex</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the index of the item being displayed in a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control from the underlying data source.</summary>
<value>The zero-based index of the data item being displayed in a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control from the underlying data source.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When the paging feature is enabled (by setting the <xref:System.Web.UI.WebControls.DetailsView.AllowPaging%2A> property to `true`), use the <xref:System.Web.UI.WebControls.DetailsView.DataItemIndex%2A> property to determine the index of the currently displayed record. You can also use this property to programmatically change the displayed record.
> [!NOTE]
> When the paging feature is enabled, you can also use this property to determine the page number of the record displayed; however, be aware that this property is zero-based.
To determine the total number of items in the data source, use the <xref:System.Web.UI.WebControls.DetailsView.DataItemCount%2A> property.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.DataItemIndex%2A> property to determine the index of the current item in the data source. This value is used to display the current page number in a <xref:System.Web.UI.WebControls.Label> control contained in a custom pager row.
[!code-aspx-csharp[DetailsViewPagerTemplate#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewPagerTemplate/CS/detailsviewpagertemplatecs.aspx#1)]
[!code-aspx-vb[DetailsViewPagerTemplate#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewPagerTemplate/VB/detailsviewpagertemplatevb.aspx#1)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.DetailsView.AllowPaging" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.DataItemCount" />
</Docs>
</Member>
<Member MemberName="DataKey">
<MemberSignature Language="C#" Value="public virtual System.Web.UI.WebControls.DataKey DataKey { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.WebControls.DataKey DataKey" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.DataKey" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property DataKey As DataKey" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Web::UI::WebControls::DataKey ^ DataKey { System::Web::UI::WebControls::DataKey ^ get(); };" />
<MemberSignature Language="F#" Value="member this.DataKey : System.Web.UI.WebControls.DataKey" Usage="System.Web.UI.WebControls.DetailsView.DataKey" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Web.UI.WebControls.IDataBoundItemControl.DataKey</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.DataKey</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a <see cref="T:System.Web.UI.WebControls.DataKey" /> object that represents the primary key of the displayed record.</summary>
<value>A <see cref="T:System.Web.UI.WebControls.DataKey" /> that represents the primary key of the displayed record.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When the <xref:System.Web.UI.WebControls.DetailsView.DataKeyNames%2A> property is set, the <xref:System.Web.UI.WebControls.DetailsView> control automatically creates a <xref:System.Web.UI.WebControls.DataKey> object that represents the key field or fields for the current record. Use the <xref:System.Web.UI.WebControls.DetailsView.DataKey%2A> property to get this <xref:System.Web.UI.WebControls.DataKey> object. This property is commonly used to obtain the keys and their corresponding values for the fields specified in the <xref:System.Web.UI.WebControls.DetailsView.DataKeyNames%2A> property.
> [!NOTE]
> As a shortcut, you can also use the <xref:System.Web.UI.WebControls.DetailsView.SelectedValue%2A> property to determine the value of the first key field listed in the <xref:System.Web.UI.WebControls.DetailsView.DataKeyNames%2A> property.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.DataKey%2A> property to determine the key field and corresponding value for the current record.
[!code-aspx-csharp[DetailsViewDataKey#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewDataKey/CS/detailsviewdatakeycs.aspx#1)]
[!code-aspx-vb[DetailsViewDataKey#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewDataKey/VB/detailsviewdatakeyvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.DataKey" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.DataKeyNames" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.SelectedValue" />
</Docs>
</Member>
<Member MemberName="DataKeyNames">
<MemberSignature Language="C#" Value="public virtual string[] DataKeyNames { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string[] DataKeyNames" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.DataKeyNames" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property DataKeyNames As String()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property cli::array &lt;System::String ^&gt; ^ DataKeyNames { cli::array &lt;System::String ^&gt; ^ get(); void set(cli::array &lt;System::String ^&gt; ^ value); };" />
<MemberSignature Language="F#" Value="member this.DataKeyNames : string[] with get, set" Usage="System.Web.UI.WebControls.DetailsView.DataKeyNames" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Web.UI.WebControls.IDataBoundControl.DataKeyNames</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(null)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.ComponentModel.Editor("System.Web.UI.Design.WebControls.DataFieldEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.TypeConverter(typeof(System.Web.UI.WebControls.StringArrayConverter))</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.Editor("System.Web.UI.Design.WebControls.DataFieldEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String[]</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets an array that contains the names of the key fields for the data source.</summary>
<value>An array that contains the names of the key fields of the data source.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.DetailsView.DataKeyNames%2A> property to specify a comma-separated list of field names that represent the primary key of the data source. When the <xref:System.Web.UI.WebControls.DetailsView.DataKeyNames%2A> property is set, the <xref:System.Web.UI.WebControls.DetailsView> control automatically creates a <xref:System.Web.UI.WebControls.DataKey> object that represents the key field or fields for the current record and stores it in the <xref:System.Web.UI.WebControls.DetailsView.DataKey%2A> property. When the <xref:System.Web.UI.WebControls.GridView.AutoGenerateColumns%2A> property is also set to `true`, the <xref:System.Web.UI.WebControls.DetailsView> control automatically ensures that the field or fields specified in the <xref:System.Web.UI.WebControls.DetailsView.DataKeyNames%2A> property are read-only.
> [!NOTE]
> You must set the <xref:System.Web.UI.WebControls.DetailsView.DataKeyNames%2A> property for the automatic updating, deleting, and inserting features of the <xref:System.Web.UI.WebControls.DetailsView> control to work.
If the <xref:System.Web.UI.WebControls.DataControlField.Visible%2A> property of a row field is set to `false`, the row is not displayed in the <xref:System.Web.UI.WebControls.DetailsView> control and the data for the row does not make a round trip to the client. If you want the data for a row that is not visible to make a round trip, add the field name to the <xref:System.Web.UI.WebControls.DetailsView.DataKeyNames%2A> property.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.DataKeyNames%2A> property to identify the key field for the data source bound to the <xref:System.Web.UI.WebControls.DetailsView> control.
[!code-aspx-csharp[DetailsViewAutoGenerateDeleteButton#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewAutoGenerateDeleteButton/CS/detailsviewautogeneratedeletebuttoncs.aspx#1)]
[!code-aspx-vb[DetailsViewAutoGenerateDeleteButton#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewAutoGenerateDeleteButton/VB/detailsviewautogeneratedeletebuttonvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.DetailsView.DataKey" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.SelectedValue" />
</Docs>
</Member>
<Member MemberName="DefaultMode">
<MemberSignature Language="C#" Value="public virtual System.Web.UI.WebControls.DetailsViewMode DefaultMode { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Web.UI.WebControls.DetailsViewMode DefaultMode" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.DefaultMode" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property DefaultMode As DetailsViewMode" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Web::UI::WebControls::DetailsViewMode DefaultMode { System::Web::UI::WebControls::DetailsViewMode get(); void set(System::Web::UI::WebControls::DetailsViewMode value); };" />
<MemberSignature Language="F#" Value="member this.DefaultMode : System.Web.UI.WebControls.DetailsViewMode with get, set" Usage="System.Web.UI.WebControls.DetailsView.DefaultMode" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(Mono.Cecil.CustomAttributeArgument)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.DetailsViewMode</ReturnType>
</ReturnValue>
<Docs>
<summary>Get or sets the default data-entry mode of the <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</summary>
<value>One of the <see cref="T:System.Web.UI.WebControls.DetailsViewMode" /> values. The default is <see langword="DetailsViewMode.ReadOnly" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.DetailsView.DefaultMode%2A> property to specify whether the <xref:System.Web.UI.WebControls.DetailsView> control returns to edit, insert, or read-only mode after an edit or insert operation is performed. By default, the <xref:System.Web.UI.WebControls.DetailsView> control returns to read-only mode; however, you can keep the <xref:System.Web.UI.WebControls.DetailsView> control in edit or insert mode by setting this property to the appropriate value. The following table lists the different mode values.
|Mode|Description|
|----------|-----------------|
|`DetailsViewMode.Edit`|The <xref:System.Web.UI.WebControls.DetailsView> control is in edit mode, which allows the user to update the values of a record.|
|`DetailsViewMode.Insert`|The <xref:System.Web.UI.WebControls.DetailsView> control is in insert mode, which allows the user to add a new record to the data source.|
|`DetailsViewMode.ReadOnly`|The <xref:System.Web.UI.WebControls.DetailsView> control is in read-only mode, which is the normal display mode.|
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.DefaultMode%2A> property to specify that the <xref:System.Web.UI.WebControls.DetailsView> control should remain in edit mode after a record has been updated.
[!code-aspx-csharp[DetailsViewDefaultMode#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewDefaultMode/CS/detailsviewdefaultmodecs.aspx#1)]
[!code-aspx-vb[DetailsViewDefaultMode#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewDefaultMode/VB/detailsviewdefaultmodevb.aspx#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The specified value is not one of the <see cref="T:System.Web.UI.WebControls.DetailsViewMode" /> enumeration values.</exception>
<altmember cref="T:System.Web.UI.WebControls.DetailsViewMode" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.CurrentMode" />
<altmember cref="M:System.Web.UI.WebControls.DetailsView.ChangeMode(System.Web.UI.WebControls.DetailsViewMode)" />
</Docs>
</Member>
<Member MemberName="DeleteItem">
<MemberSignature Language="C#" Value="public virtual void DeleteItem ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void DeleteItem() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.DetailsView.DeleteItem" />
<MemberSignature Language="VB.NET" Value="Public Overridable Sub DeleteItem ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void DeleteItem();" />
<MemberSignature Language="F#" Value="abstract member DeleteItem : unit -&gt; unit&#xA;override this.DeleteItem : unit -&gt; unit" Usage="detailsView.DeleteItem " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Deletes the current record from the data source.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The deletion does not occur if the <xref:System.Web.UI.WebControls.DetailsView> control is in Insert mode. The <xref:System.Web.UI.WebControls.DetailsView.ItemDeleting> event is raised immediately before the item is deleted. Set the <xref:System.ComponentModel.CancelEventArgs.Cancel%2A> property to `true` to cancel the deletion.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="DeleteMethod">
<MemberSignature Language="C#" Value="public virtual string DeleteMethod { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string DeleteMethod" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.DeleteMethod" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property DeleteMethod As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::String ^ DeleteMethod { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.DeleteMethod : string with get, set" Usage="System.Web.UI.WebControls.DetailsView.DeleteMethod" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.ComponentModel.DefaultValue("")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.Web.UI.Themeable(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the name of the method on the page that is called when the control performs a delete operation.</summary>
<value>The name of the method on the page that is called when the control performs a delete operation.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
For a tutorial series on using model binding with Web Forms, see [Model Binding and Web Forms](/aspnet/web-forms/overview/presenting-and-managing-data/model-binding/retrieving-data).
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="EditRowStyle">
<MemberSignature Language="C#" Value="public System.Web.UI.WebControls.TableItemStyle EditRowStyle { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.WebControls.TableItemStyle EditRowStyle" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.EditRowStyle" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property EditRowStyle As TableItemStyle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Web::UI::WebControls::TableItemStyle ^ EditRowStyle { System::Web::UI::WebControls::TableItemStyle ^ get(); };" />
<MemberSignature Language="F#" Value="member this.EditRowStyle : System.Web.UI.WebControls.TableItemStyle" Usage="System.Web.UI.WebControls.DetailsView.EditRowStyle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(null)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.NotifyParentProperty(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.TableItemStyle</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a reference to the <see cref="T:System.Web.UI.WebControls.TableItemStyle" /> object that allows you to set the appearance of the data rows when a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control is in edit mode.</summary>
<value>A reference to the <see cref="T:System.Web.UI.WebControls.TableItemStyle" /> that represents the style of the data rows when a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control is in edit mode.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.DetailsView.EditRowStyle%2A> property to control the appearance of the data rows when a <xref:System.Web.UI.WebControls.DetailsView> control is in edit mode. This property is read-only; however, you can set the properties of the <xref:System.Web.UI.WebControls.TableItemStyle> object it returns. The properties can be set declaratively in the form `Property-Subproperty`, where `Subproperty` is a property of the <xref:System.Web.UI.WebControls.TableItemStyle> object (for example, `EditRowStyle-ForeColor`). The properties can also be set programmatically in the form `Property.Subproperty` (for example, `EditRowStyle.ForeColor`). Common settings usually include a custom background color, foreground color, and font properties.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.EditRowStyle%2A> property to specify the font and style settings for the data rows when a <xref:System.Web.UI.WebControls.DetailsView> control is in edit mode.
[!code-aspx-csharp[DetailsViewEditRowStyle#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewEditRowStyle/CS/detailsvieweditrowstylecs.aspx#1)]
[!code-aspx-vb[DetailsViewEditRowStyle#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewEditRowStyle/VB/detailsvieweditrowstylevb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TableItemStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.AlternatingRowStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.CommandRowStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.EmptyDataRowStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.FooterStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.FieldHeaderStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.HeaderStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.InsertRowStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.RowStyle" />
</Docs>
</Member>
<Member MemberName="EmptyDataRowStyle">
<MemberSignature Language="C#" Value="public System.Web.UI.WebControls.TableItemStyle EmptyDataRowStyle { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.WebControls.TableItemStyle EmptyDataRowStyle" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.EmptyDataRowStyle" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property EmptyDataRowStyle As TableItemStyle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Web::UI::WebControls::TableItemStyle ^ EmptyDataRowStyle { System::Web::UI::WebControls::TableItemStyle ^ get(); };" />
<MemberSignature Language="F#" Value="member this.EmptyDataRowStyle : System.Web.UI.WebControls.TableItemStyle" Usage="System.Web.UI.WebControls.DetailsView.EmptyDataRowStyle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(null)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.NotifyParentProperty(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.TableItemStyle</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a reference to the <see cref="T:System.Web.UI.WebControls.TableItemStyle" /> object that allows you to set the appearance of the empty data row displayed when the data source bound to a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control does not contain any records.</summary>
<value>A reference to the <see cref="T:System.Web.UI.WebControls.TableItemStyle" /> that allows you to set the appearance of the empty data row.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.DetailsView.EmptyDataRowStyle%2A> property to control the appearance of the empty data row in a <xref:System.Web.UI.WebControls.DetailsView> control. The empty data row is displayed when the data source that is bound to the control does not contain any records. This property is read-only; however, you can set the properties of the <xref:System.Web.UI.WebControls.TableItemStyle> object it returns. The properties can be set declaratively in the form `Property-Subproperty`, where `Subproperty` is a property of the <xref:System.Web.UI.WebControls.TableItemStyle> object (for example, `EmptyDataRowStyle-ForeColor`). The properties can also be set programmatically in the form `Property.Subproperty` (for example, `EmptyDataRowStyle.ForeColor`). Common settings usually include a custom background color, foreground color, and font properties.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.EmptyDataRowStyle%2A> property to specify the font and style settings for the empty data row.
[!code-aspx-csharp[DetailsViewEmptyDataText#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewEmptyDataText/CS/detailsviewemptydatatextcs.aspx#1)]
[!code-aspx-vb[DetailsViewEmptyDataText#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewEmptyDataText/VB/detailsviewemptydatatextvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TableItemStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.AlternatingRowStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.CommandRowStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.EditRowStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.EmptyDataTemplate" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.EmptyDataText" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.FooterStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.FieldHeaderStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.HeaderStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.InsertRowStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.RowStyle" />
</Docs>
</Member>
<Member MemberName="EmptyDataTemplate">
<MemberSignature Language="C#" Value="public virtual System.Web.UI.ITemplate EmptyDataTemplate { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.ITemplate EmptyDataTemplate" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.EmptyDataTemplate" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property EmptyDataTemplate As ITemplate" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Web::UI::ITemplate ^ EmptyDataTemplate { System::Web::UI::ITemplate ^ get(); void set(System::Web::UI::ITemplate ^ value); };" />
<MemberSignature Language="F#" Value="member this.EmptyDataTemplate : System.Web.UI.ITemplate with get, set" Usage="System.Web.UI.WebControls.DetailsView.EmptyDataTemplate" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(null)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Web.UI.TemplateContainer(typeof(System.Web.UI.WebControls.DetailsView))</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.UI.ITemplate</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the user-defined content for the empty data row rendered when a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control is bound to a data source that does not contain any records.</summary>
<value>A <see cref="T:System.Web.UI.ITemplate" /> that contains the custom content for the empty data row. The default value is <see langword="null" />, which indicates that this property is not set.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The empty data row is displayed in a <xref:System.Web.UI.WebControls.DetailsView> control when the data source that is bound to the control does not contain any records. You can define your own custom user interface (UI) for the empty data row by using the <xref:System.Web.UI.WebControls.DetailsView.EmptyDataTemplate%2A> property. To specify a custom template for the null row, first place `<EmptyDataTemplate>` tags between the opening and closing tags of the <xref:System.Web.UI.WebControls.DetailsView> control. You can then list the contents of the template between the opening and closing `<EmptyDataTemplate>` tags. To control the style of the empty data row, use the <xref:System.Web.UI.WebControls.DetailsView.EmptyDataRowStyle%2A> property. Alternatively, you can use the built-in UI for the empty data row by setting the <xref:System.Web.UI.WebControls.DetailsView.EmptyDataText%2A> property instead of this property.
> [!NOTE]
> If both the <xref:System.Web.UI.WebControls.DetailsView.EmptyDataText%2A> and <xref:System.Web.UI.WebControls.DetailsView.EmptyDataTemplate%2A> properties are set, the <xref:System.Web.UI.WebControls.DetailsView.EmptyDataTemplate%2A> property takes precedence.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.EmptyDataTemplate%2A> property to create a custom empty data row.
[!code-aspx-csharp[DetailsViewEmptyDataTemplate#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewEmptyDataTemplate/CS/detailsviewemptydatatemplatecs.aspx#1)]
[!code-aspx-vb[DetailsViewEmptyDataTemplate#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewEmptyDataTemplate/VB/detailsviewemptydatatemplatevb.aspx#1)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.DetailsView.EmptyDataRowStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.EmptyDataText" />
</Docs>
</Member>
<Member MemberName="EmptyDataText">
<MemberSignature Language="C#" Value="public virtual string EmptyDataText { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string EmptyDataText" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.EmptyDataText" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property EmptyDataText As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::String ^ EmptyDataText { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.EmptyDataText : string with get, set" Usage="System.Web.UI.WebControls.DetailsView.EmptyDataText" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue("")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.Localizable(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the text to display in the empty data row rendered when a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control is bound to a data source that does not contain any records.</summary>
<value>The text to display in the empty data row. The default is an empty string (""), which indicates that this property is not set.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The empty data row is displayed in a <xref:System.Web.UI.WebControls.DetailsView> control when the data source that is bound to the control does not contain any records. Use the <xref:System.Web.UI.WebControls.DetailsView.EmptyDataText%2A> property to specify the text to display in the empty data row. To control the style of the empty data row, use the <xref:System.Web.UI.WebControls.DetailsView.EmptyDataRowStyle%2A> property. Alternatively, you can define your own custom user interface (UI) for the empty data row by setting the <xref:System.Web.UI.WebControls.DetailsView.EmptyDataTemplate%2A> property instead of this property.
> [!NOTE]
> If both the <xref:System.Web.UI.WebControls.DetailsView.EmptyDataText%2A> and <xref:System.Web.UI.WebControls.DetailsView.EmptyDataTemplate%2A> properties are set, the <xref:System.Web.UI.WebControls.DetailsView.EmptyDataTemplate%2A> property takes precedence.
The value of <xref:System.Web.UI.WebControls.DetailsView.EmptyDataText%2A> is stored in view state.
The value of this property, when set, can be saved automatically to a resource file by using a designer tool. For more information, see <xref:System.ComponentModel.LocalizableAttribute> and [Globalization and Localization](https://msdn.microsoft.com/library/8ef3838e-9d05-4236-9dd0-ceecff9df80d).
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.EmptyDataText%2A> property to specify the text to display in the empty data row.
[!code-aspx-csharp[DetailsViewEmptyDataText#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewEmptyDataText/CS/detailsviewemptydatatextcs.aspx#1)]
[!code-aspx-vb[DetailsViewEmptyDataText#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewEmptyDataText/VB/detailsviewemptydatatextvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.DetailsView.EmptyDataRowStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.EmptyDataTemplate" />
</Docs>
</Member>
<Member MemberName="EnableModelValidation">
<MemberSignature Language="C#" Value="public virtual bool EnableModelValidation { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool EnableModelValidation" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.EnableModelValidation" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property EnableModelValidation As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property bool EnableModelValidation { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.EnableModelValidation : bool with get, set" Usage="System.Web.UI.WebControls.DetailsView.EnableModelValidation" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.ComponentModel.DefaultValue(true)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value that indicates whether data-model validation is enabled.</summary>
<value>
<see langword="true" /> if data model validation is enabled; otherwise, <see langword="false" />.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="EnablePagingCallbacks">
<MemberSignature Language="C#" Value="public virtual bool EnablePagingCallbacks { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool EnablePagingCallbacks" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.EnablePagingCallbacks" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property EnablePagingCallbacks As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property bool EnablePagingCallbacks { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.EnablePagingCallbacks : bool with get, set" Usage="System.Web.UI.WebControls.DetailsView.EnablePagingCallbacks" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(false)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether client-side callback functions are used for paging operations in the <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</summary>
<value>
<see langword="true" /> to use client-side callback functions for paging operations; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.DetailsView.EnablePagingCallbacks%2A> property to specify whether paging operations are performed using client-side callback functions. When enabled, paging is performed using the callback feature, which prevents the need to post the page back to the server.
> [!NOTE]
> The client-side paging feature is only supported in Microsoft Internet Explorer 5.5 and later and Netscape 6.0 and later.
The value of <xref:System.Web.UI.WebControls.DetailsView.EnablePagingCallbacks%2A> is stored in view state.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.EnablePagingCallbacks%2A> property to enable the use of client-side callback functions for paging operations.
[!code-aspx-csharp[DetailsViewEnablePagingCallbacks#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewEnablePagingCallbacks/CS/detailsviewenablepagingcallbackscs.aspx#1)]
[!code-aspx-vb[DetailsViewEnablePagingCallbacks#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewEnablePagingCallbacks/VB/detailsviewenablepagingcallbacksvb.aspx#1)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.DetailsView.AllowPaging" />
</Docs>
</Member>
<Member MemberName="EnsureDataBound">
<MemberSignature Language="C#" Value="protected override void EnsureDataBound ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void EnsureDataBound() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.DetailsView.EnsureDataBound" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub EnsureDataBound ()" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void EnsureDataBound();" />
<MemberSignature Language="F#" Value="override this.EnsureDataBound : unit -&gt; unit" Usage="detailsView.EnsureDataBound " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Calls the <see cref="M:System.Web.UI.WebControls.BaseDataBoundControl.DataBind" /> method after verifying that the data listing control requires data binding and that a valid data source control is specified.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The data binding does not occur if the <xref:System.Web.UI.WebControls.DetailsView> control is in Insert mode.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When extending the <see cref="T:System.Web.UI.WebControls.DetailsView" /> class, you can override this method to implement additional processing before the control is data-bound.</para>
</block>
</Docs>
</Member>
<Member MemberName="ExtractRowValues">
<MemberSignature Language="C#" Value="protected virtual void ExtractRowValues (System.Collections.Specialized.IOrderedDictionary fieldValues, bool includeReadOnlyFields, bool includeKeys);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void ExtractRowValues(class System.Collections.Specialized.IOrderedDictionary fieldValues, bool includeReadOnlyFields, bool includeKeys) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.DetailsView.ExtractRowValues(System.Collections.Specialized.IOrderedDictionary,System.Boolean,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub ExtractRowValues (fieldValues As IOrderedDictionary, includeReadOnlyFields As Boolean, includeKeys As Boolean)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void ExtractRowValues(System::Collections::Specialized::IOrderedDictionary ^ fieldValues, bool includeReadOnlyFields, bool includeKeys);" />
<MemberSignature Language="F#" Value="abstract member ExtractRowValues : System.Collections.Specialized.IOrderedDictionary * bool * bool -&gt; unit&#xA;override this.ExtractRowValues : System.Collections.Specialized.IOrderedDictionary * bool * bool -&gt; unit" Usage="detailsView.ExtractRowValues (fieldValues, includeReadOnlyFields, includeKeys)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="fieldValues" Type="System.Collections.Specialized.IOrderedDictionary" />
<Parameter Name="includeReadOnlyFields" Type="System.Boolean" />
<Parameter Name="includeKeys" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="fieldValues">An <see cref="T:System.Collections.Specialized.IOrderedDictionary" /> used to store the field values.</param>
<param name="includeReadOnlyFields">
<see langword="true" /> to include read-only fields; otherwise, <see langword="false" />.</param>
<param name="includeKeys">
<see langword="true" /> to include the primary key field or fields; otherwise, <see langword="false" />.</param>
<summary>Retrieves the values of each field displayed and stores them in the specified <see cref="T:System.Collections.Specialized.IOrderedDictionary" /> object.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.DetailsView.ExtractRowValues%2A> method is a helper method called by the <xref:System.Web.UI.WebControls.DetailsView> control to retrieve the values of each field. The values can them be used for data source operations. You can specify whether the extracted values include read-only fields and key fields by using the `includeReadOnlyFields` and `includePrimaryKey` parameters, respectively.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When extending the <see cref="T:System.Web.UI.WebControls.DetailsView" /> class, you can override this method to create your own routine to retrieve the field values.</para>
</block>
</Docs>
</Member>
<Member MemberName="FieldHeaderStyle">
<MemberSignature Language="C#" Value="public System.Web.UI.WebControls.TableItemStyle FieldHeaderStyle { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.WebControls.TableItemStyle FieldHeaderStyle" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.FieldHeaderStyle" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property FieldHeaderStyle As TableItemStyle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Web::UI::WebControls::TableItemStyle ^ FieldHeaderStyle { System::Web::UI::WebControls::TableItemStyle ^ get(); };" />
<MemberSignature Language="F#" Value="member this.FieldHeaderStyle : System.Web.UI.WebControls.TableItemStyle" Usage="System.Web.UI.WebControls.DetailsView.FieldHeaderStyle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(null)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.NotifyParentProperty(true)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Content)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.TableItemStyle</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a reference to the <see cref="T:System.Web.UI.WebControls.TableItemStyle" /> object that allows you to set the appearance of the header column in a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</summary>
<value>A reference to the <see cref="T:System.Web.UI.WebControls.TableItemStyle" /> that represents the style of the header column in a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.DetailsView.FieldHeaderStyle%2A> property to control the appearance of the field header column in a <xref:System.Web.UI.WebControls.DetailsView> control. This is the column that contains the field names of the data values. This property is read-only; however, you can set the properties of the <xref:System.Web.UI.WebControls.TableItemStyle> object it returns. The properties can be set declaratively in the form `Property-Subproperty`, where `Subproperty` is a property of the <xref:System.Web.UI.WebControls.TableItemStyle> object (for example, `FieldHeaderStyle-ForeColor`). The properties can also be set programmatically in the form `Property.Subproperty` (for example, `FieldHeaderStyle.ForeColor`). Common settings usually include a custom background color, foreground color, and font properties.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.FieldHeaderStyle%2A> property to specify the font and style settings for the field header row.
[!code-aspx-csharp[DetailsViewFieldHeaderStyle#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewFieldHeaderStyle/CS/FieldHeaderStyleCS.aspx#1)]
[!code-aspx-vb[DetailsViewFieldHeaderStyle#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewFieldHeaderStyle/VB/FieldHeaderStyleVB.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.TableItemStyle" />
</Docs>
</Member>
<Member MemberName="Fields">
<MemberSignature Language="C#" Value="public virtual System.Web.UI.WebControls.DataControlFieldCollection Fields { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.WebControls.DataControlFieldCollection Fields" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.Fields" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property Fields As DataControlFieldCollection" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Web::UI::WebControls::DataControlFieldCollection ^ Fields { System::Web::UI::WebControls::DataControlFieldCollection ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Fields : System.Web.UI.WebControls.DataControlFieldCollection" Usage="System.Web.UI.WebControls.DetailsView.Fields" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(null)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8">
<AttributeName>System.ComponentModel.Editor("System.Web.UI.Design.WebControls.DataControlFieldTypeEditor, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.MergableProperty(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-2.0;netframework-3.0;netframework-3.5">
<AttributeName>System.ComponentModel.Editor("System.Web.UI.Design.WebControls.DataControlFieldTypeEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.DataControlFieldCollection</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a collection of <see cref="T:System.Web.UI.WebControls.DataControlField" /> objects that represent the explicitly declared row fields in a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</summary>
<value>A <see cref="T:System.Web.UI.WebControls.DataControlFieldCollection" /> that contains all explicitly declared row fields in the <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When you explicitly declare the row fields for a <xref:System.Web.UI.WebControls.DetailsView> control, these row fields are stored in the <xref:System.Web.UI.WebControls.DetailsView.Fields%2A> property (collection). The <xref:System.Web.UI.WebControls.DetailsView.Fields%2A> collection also allows you to programmatically manage the collection of explicitly declared rows.
> [!NOTE]
> Explicitly declared row fields can be used in combination with automatically generated row fields. When both are used, explicitly declared row fields are rendered first, followed by the automatically generated row fields. Automatically generated row fields are not added to the <xref:System.Web.UI.WebControls.DetailsView.Fields%2A> collection.
Different row field types determine the behavior of the rows in the control. The following table shows the different row field types that can be used in the <xref:System.Web.UI.WebControls.DetailsView.Fields%2A> collection.
|Row field type|Description|
|--------------------|-----------------|
|<xref:System.Web.UI.WebControls.BoundField>|Displays the value of a field in a data source as text.|
|<xref:System.Web.UI.WebControls.ButtonField>|Displays a command button in the <xref:System.Web.UI.WebControls.DetailsView> control. This allows you to display a row with a custom button control, such as an Add or a Remove button.|
|<xref:System.Web.UI.WebControls.CheckBoxField>|Displays a check box in the <xref:System.Web.UI.WebControls.DetailsView> control. This row field type is commonly used to display fields with a Boolean value.|
|<xref:System.Web.UI.WebControls.CommandField>|Displays built-in command buttons to perform edit, insert, or delete operations in the <xref:System.Web.UI.WebControls.DetailsView> control.|
|<xref:System.Web.UI.WebControls.HyperLinkField>|Displays the value of a field in a data source as a hyperlink. This row field type allows you to bind a second field to the hyperlink's URL.|
|<xref:System.Web.UI.WebControls.ImageField>|Displays an image in the <xref:System.Web.UI.WebControls.DetailsView> control.|
|<xref:System.Web.UI.WebControls.TemplateField>|Displays user-defined content for a row in the <xref:System.Web.UI.WebControls.DetailsView> control according to a specified template. This row field type allows you to create a custom row field.|
To explicitly declare the row fields for a <xref:System.Web.UI.WebControls.DetailsView> control, first set the <xref:System.Web.UI.WebControls.DetailsView.AutoGenerateRows%2A> property to `false`. Next, add opening and closing `<Fields>` tags between the opening and closing tags of the <xref:System.Web.UI.WebControls.DetailsView> control. Finally, list the row fields that you want to include between the opening and closing `<Fields>` tags. The row fields are displayed in the <xref:System.Web.UI.WebControls.DetailsView> control in the order that the row fields appear in the <xref:System.Web.UI.WebControls.DetailsView.Fields%2A> collection.
Although you can programmatically add row fields to the <xref:System.Web.UI.WebControls.DetailsView.Fields%2A> collection, it is easier to list the row fields declaratively in the <xref:System.Web.UI.WebControls.DetailsView> control and then use the <xref:System.Web.UI.WebControls.DataControlField.Visible%2A> property of each row field to show or hide the row field.
If the <xref:System.Web.UI.WebControls.DataControlField.Visible%2A> property of a row field is set to `false`, the row is not displayed in the <xref:System.Web.UI.WebControls.DetailsView> control and the data for the row does not make a round trip to the client. If you want the data for a row that is not visible to make a round trip, add the field name to the <xref:System.Web.UI.WebControls.DetailsView.DataKeyNames%2A> property.
## Examples
The following code example demonstrates how to declaratively add row fields to the <xref:System.Web.UI.WebControls.DetailsView.Fields%2A> collection of a <xref:System.Web.UI.WebControls.DetailsView> control.
[!code-aspx-csharp[DetailsViewFields#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewFields/CS/DetailsViewFieldsCS.aspx#1)]
[!code-aspx-vb[DetailsViewFields#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewFields/VB/DetailsViewFieldsVB.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.DataControlField" />
<altmember cref="T:System.Web.UI.WebControls.DataControlFieldCollection" />
<altmember cref="T:System.Web.UI.WebControls.BoundField" />
<altmember cref="T:System.Web.UI.WebControls.ButtonField" />
<altmember cref="T:System.Web.UI.WebControls.CheckBoxField" />
<altmember cref="T:System.Web.UI.WebControls.CommandField" />
<altmember cref="T:System.Web.UI.WebControls.HyperLinkField" />
<altmember cref="T:System.Web.UI.WebControls.TemplateField" />
</Docs>
</Member>
<Member MemberName="FooterRow">
<MemberSignature Language="C#" Value="public virtual System.Web.UI.WebControls.DetailsViewRow FooterRow { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.WebControls.DetailsViewRow FooterRow" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.FooterRow" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property FooterRow As DetailsViewRow" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Web::UI::WebControls::DetailsViewRow ^ FooterRow { System::Web::UI::WebControls::DetailsViewRow ^ get(); };" />
<MemberSignature Language="F#" Value="member this.FooterRow : System.Web.UI.WebControls.DetailsViewRow" Usage="System.Web.UI.WebControls.DetailsView.FooterRow" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.DetailsViewRow</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a <see cref="T:System.Web.UI.WebControls.DetailsViewRow" /> object that represents the footer row in a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</summary>
<value>A <see cref="T:System.Web.UI.WebControls.DetailsViewRow" /> that represents the footer row in a <see cref="T:System.Web.UI.WebControls.DetailsView" /> control.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The footer row is displayed at the bottom of the <xref:System.Web.UI.WebControls.DetailsView> control when the <xref:System.Web.UI.WebControls.DetailsView.FooterText%2A> or <xref:System.Web.UI.WebControls.DetailsView.FooterTemplate%2A> property is set. Use the <xref:System.Web.UI.WebControls.DetailsView.FooterRow%2A> property to programmatically access the <xref:System.Web.UI.WebControls.DetailsViewRow> object that represents the footer row.
> [!NOTE]
> The <xref:System.Web.UI.WebControls.GridView.FooterRow%2A> property is available only after the <xref:System.Web.UI.WebControls.DetailsView> control creates the footer row in the <xref:System.Web.UI.WebControls.DetailsView.ItemCreated> event.
This property is commonly used when you need to programmatically manipulate the footer row, for example when adding custom content. Any modification to the <xref:System.Web.UI.WebControls.DetailsView.FooterRow%2A> property must be performed after the <xref:System.Web.UI.WebControls.DetailsView> control has been rendered; otherwise, the <xref:System.Web.UI.WebControls.DetailsView> control will overwrite any changes.
To control the style of the footer row, use the <xref:System.Web.UI.WebControls.DetailsView.FooterStyle%2A> property.
## Examples
The following code example demonstrates how to use the <xref:System.Web.UI.WebControls.DetailsView.FooterRow%2A> property to access the footer row of the <xref:System.Web.UI.WebControls.DetailsView> control during the <xref:System.Web.UI.WebControls.DetailsView.ItemCreated> event. A <xref:System.Web.UI.WebControls.Label> control within the custom footer row is then updated with the current page number.
[!code-aspx-csharp[DetailsViewFooterTemplate#1](~/samples/snippets/csharp/VS_Snippets_WebNet/DetailsViewFooterTemplate/CS/detailsviewfootertemplatecs.aspx#1)]
[!code-aspx-vb[DetailsViewFooterTemplate#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/DetailsViewFooterTemplate/VB/detailsviewfootertemplatevb.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.DetailsViewRow" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.FooterStyle" />
<altmember cref="P:System.Web.UI.WebControls.DetailsView.HeaderRow" />
</Docs>
</Member>
<Member MemberName="FooterStyle">
<MemberSignature Language="C#" Value="public System.Web.UI.WebControls.TableItemStyle FooterStyle { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.WebControls.TableItemStyle FooterStyle" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.DetailsView.FooterStyle" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property FooterStyle As TableItemStyle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Web::UI::WebControls::TableItemStyle ^ FooterStyle { System::Web::UI::WebControls::TableItemStyle ^ get(); };" />
<MemberSignature Language="F#" Value="member this.FooterStyle : System.Web.UI.WebControls.TableItemStyle" Usage="System.Web.UI.WebControls.DetailsView.FooterStyle&qu