Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
7005 lines (6295 sloc) 532 KB
<Type Name="ListView" FullName="System.Web.UI.WebControls.ListView">
<TypeSignature Language="C#" Value="public class ListView : System.Web.UI.WebControls.DataBoundControl, System.Web.UI.IDataKeysControl, System.Web.UI.INamingContainer, System.Web.UI.WebControls.IDataBoundListControl, System.Web.UI.WebControls.IPageableItemContainer, System.Web.UI.WebControls.IPersistedSelector" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit ListView extends System.Web.UI.WebControls.DataBoundControl implements class System.Web.UI.IDataKeysControl, class System.Web.UI.INamingContainer, class System.Web.UI.WebControls.IDataBoundControl, class System.Web.UI.WebControls.IDataBoundListControl, class System.Web.UI.WebControls.IPageableItemContainer, class System.Web.UI.WebControls.IPersistedSelector" />
<TypeSignature Language="DocId" Value="T:System.Web.UI.WebControls.ListView" />
<TypeSignature Language="VB.NET" Value="Public Class ListView&#xA;Inherits DataBoundControl&#xA;Implements IDataBoundListControl, IDataKeysControl, INamingContainer, IPageableItemContainer, IPersistedSelector" />
<TypeSignature Language="C++ CLI" Value="public ref class ListView : System::Web::UI::WebControls::DataBoundControl, System::Web::UI::IDataKeysControl, System::Web::UI::INamingContainer, System::Web::UI::WebControls::IDataBoundListControl, System::Web::UI::WebControls::IPageableItemContainer, System::Web::UI::WebControls::IPersistedSelector" />
<TypeSignature Language="F#" Value="type ListView = class&#xA; inherit DataBoundControl&#xA; interface INamingContainer&#xA; interface IPageableItemContainer&#xA; interface IPersistedSelector&#xA; interface IDataKeysControl&#xA; interface IDataBoundListControl&#xA; interface IDataBoundControl" />
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Web.UI.WebControls.DataBoundControl</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.Web.UI.IDataKeysControl</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Web.UI.INamingContainer</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Web.UI.WebControls.IDataBoundControl</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Web.UI.WebControls.IDataBoundListControl</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Web.UI.WebControls.IPageableItemContainer</InterfaceName>
</Interface>
<Interface>
<InterfaceName>System.Web.UI.WebControls.IPersistedSelector</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.DefaultEvent("SelectedIndexChanged")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultProperty("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.ComponentModel.Designer("System.Web.UI.Design.WebControls.ListViewDesigner, System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")</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.Drawing.ToolboxBitmap(typeof(System.Web.UI.WebControls.ListView), "ListView.bmp")</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("SelectedPersistedDataKey")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Web.UI.SupportsEventValidation</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-3.5">
<AttributeName>System.ComponentModel.Designer("System.Web.UI.Design.WebControls.ListViewDesigner, System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-3.5">
<AttributeName>System.ComponentModel.ToolboxItemFilter("System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35", System.ComponentModel.ToolboxItemFilterType.Require)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-3.5">
<AttributeName>System.Drawing.ToolboxBitmap(typeof(System.Web.UI.WebControls.ListView), "ListView.ico")</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Displays the values of a data source by using user-defined templates. The <see cref="T:System.Web.UI.WebControls.ListView" /> control enables users to select, sort, delete, edit, and insert records.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
In this topic:
- [Introduction](#introduction)
- [Templates](#templates)
- [Binding to a Data Source](#binding_to_a_data_source)
- [Data Operations](#data_operations)
- [Events](#Events)
- [Declarative Syntax](#declarative_syntax)
<a name="introduction"></a>
## Introduction
The <xref:System.Web.UI.WebControls.ListView> control is used to display the values from a data source. It resembles the <xref:System.Web.UI.WebControls.GridView> control, except that it displays data by using user-defined templates instead of row fields. Creating your own templates gives you more flexibility in controlling how the data is displayed.
A Visual Studio project with source code is available to accompany this topic: [Download](https://go.microsoft.com/fwlink/?LinkId=199759).
The <xref:System.Web.UI.WebControls.ListView> control supports the following features:
- Support for binding to data source controls such as <xref:System.Web.UI.WebControls.SqlDataSource>, <xref:System.Web.UI.WebControls.LinqDataSource>, and <xref:System.Web.UI.WebControls.ObjectDataSource>.
- Customizable appearance through user-defined templates and styles.
- Built-in sorting capabilities.
- Built-in update and delete capabilities.
- Built-in insert capabilities.
- Support for paging capabilities by using a <xref:System.Web.UI.WebControls.DataPager> control.
- Built-in item selection capabilities.
- Programmatic access to the <xref:System.Web.UI.WebControls.ListView> object model to dynamically set properties, handle events, and so on.
- Multiple key fields.
To learn about other data-bound controls that are available in ASP.NET, see [Data-Bound Web Server Controls](https://msdn.microsoft.com/library/f9cf026e-d8b8-49f8-a3c4-64de2edbbb96).
<a name="templates"></a>
## Templates
In order for the <xref:System.Web.UI.WebControls.ListView> control to display content, you must create templates for different parts of the control. The <xref:System.Web.UI.WebControls.ListView.ItemTemplate%2A> is required. All other templates are optional. The <xref:System.Web.UI.WebControls.ListView.LayoutTemplate%2A> property is not required.
However, you must create a template for the mode in which the control is configured. For example, a <xref:System.Web.UI.WebControls.ListView> control that supports inserting records must have an <xref:System.Web.UI.WebControls.ListView.InsertItemTemplate%2A> template defined. The following table lists the templates that you can create for the <xref:System.Web.UI.WebControls.ListView> control.
|Template type|Description|
|-------------------|-----------------|
|<xref:System.Web.UI.WebControls.ListView.LayoutTemplate%2A>|The root template that defines a container object, such as a `table`, `div`, or `span` element, that will contain the content defined in the <xref:System.Web.UI.WebControls.ListView.ItemTemplate%2A> or <xref:System.Web.UI.WebControls.ListView.GroupTemplate%2A> template. It might also contain a <xref:System.Web.UI.WebControls.DataPager> object.|
|<xref:System.Web.UI.WebControls.ListView.ItemTemplate%2A>|Defines the data-bound content to display for individual items.|
|<xref:System.Web.UI.WebControls.ListView.ItemSeparatorTemplate%2A>|Defines the content to render between individual items.|
|<xref:System.Web.UI.WebControls.ListView.GroupTemplate%2A>|Defines a container object, such as a table row (`tr`), `div`, or `span` element, that will contain the content defined in the <xref:System.Web.UI.WebControls.ListView.ItemTemplate%2A> and <xref:System.Web.UI.WebControls.ListView.EmptyItemTemplate%2A> templates. The number of items that are displayed in a group is specified by the <xref:System.Web.UI.WebControls.ListView.GroupItemCount%2A> property.|
|<xref:System.Web.UI.WebControls.ListView.GroupSeparatorTemplate%2A>|Defines the content to render between groups of items.|
|<xref:System.Web.UI.WebControls.ListView.EmptyItemTemplate%2A>|Defines the content to render for an empty item when a <xref:System.Web.UI.WebControls.ListView.GroupTemplate%2A> template is used. For example, if the <xref:System.Web.UI.WebControls.ListView.GroupItemCount%2A> property is set to 5, and the total number of items returned from the data source is 8, the last group of data displayed by the <xref:System.Web.UI.WebControls.ListView> control will contain three items as specified by the <xref:System.Web.UI.WebControls.ListView.ItemTemplate%2A> template, and two items as specified by the <xref:System.Web.UI.WebControls.ListView.EmptyItemTemplate%2A> template.|
|<xref:System.Web.UI.WebControls.ListView.EmptyDataTemplate%2A>|Defines the content to render if the data source returns no data.|
|<xref:System.Web.UI.WebControls.ListView.SelectedItemTemplate%2A>|Defines the content to render for the selected data item to differentiate the selected item from other items.|
|<xref:System.Web.UI.WebControls.ListView.AlternatingItemTemplate%2A>|Defines the content to render for alternating items to make it easier to distinguish between consecutive items.|
|<xref:System.Web.UI.WebControls.ListView.EditItemTemplate%2A>|Defines the content to render when an item is being edited. The <xref:System.Web.UI.WebControls.ListView.EditItemTemplate%2A> template is rendered in place of the <xref:System.Web.UI.WebControls.ListView.ItemTemplate%2A> template for the data item that is being edited.|
|<xref:System.Web.UI.WebControls.ListView.InsertItemTemplate%2A>|Defines the content to render to insert an item. The <xref:System.Web.UI.WebControls.ListView.InsertItemTemplate%2A> template is rendered in place of an <xref:System.Web.UI.WebControls.ListView.ItemTemplate%2A> template at either the start or at the end of the items that are displayed by the <xref:System.Web.UI.WebControls.ListView> control. You can specify where the <xref:System.Web.UI.WebControls.ListView.InsertItemTemplate%2A> template is rendered by using the <xref:System.Web.UI.WebControls.ListView.InsertItemPosition%2A> property of the <xref:System.Web.UI.WebControls.ListView> control.|
To display the value of a field in a template such as <xref:System.Web.UI.WebControls.ListView.ItemTemplate%2A>, you use a data-binding expression. For more information about data-binding expressions, see [Data-Binding Expressions Overview](https://msdn.microsoft.com/library/14cdd57d-0f82-4667-b503-73e1a96f136a).
To bind input controls in the <xref:System.Web.UI.WebControls.ListView.EditItemTemplate%2A> and <xref:System.Web.UI.WebControls.ListView.InsertItemTemplate%2A> templates to fields of a data source, you can use two-way binding expressions. This enables the <xref:System.Web.UI.WebControls.ListView> control to automatically extract the values of the input control for an update or insert operation. Two-way binding expressions also enable input controls in an <xref:System.Web.UI.WebControls.ListView.EditItemTemplate%2A> to automatically display the original field values. For more information about two-way binding expressions, see [Binding to Databases](https://msdn.microsoft.com/library/ab7b2846-975b-4057-a948-45527497c742).
<a name="binding_to_a_data_source"></a>
## Binding to a Data Source
You can bind the <xref:System.Web.UI.WebControls.ListView> control 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.ListView> 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.ListView> control to the <xref:System.Web.UI.Control.ID%2A> value of the data source control. The <xref:System.Web.UI.WebControls.ListView> control automatically binds to the specified data source control and can take advantage of the data source control's capabilities to perform sorting, inserting, updating, deleting, and paging functionality. 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.ListView> control to the data source, and then call the <xref:System.Web.UI.WebControls.BaseDataBoundControl.DataBind%2A> method. When you use this technique, the <xref:System.Web.UI.WebControls.ListView> control does not provide built-in sorting, updating, deleting, and paging functionality. You must provide this functionality by using the appropriate event.
For more information about data binding, see [ASP.NET Data Access Content Map](https://msdn.microsoft.com/library/f9219396-a0fa-481f-894d-e3d9c67d64f2).
> [!NOTE]
> The <xref:System.Web.UI.WebControls.ListView> 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 you display it in the application. We strongly recommend that values be HTML-encoded whenever possible before they are displayed in this control. ASP.NET provides an input request validation feature to help block script and HTML in user input. You can also use validation server controls to check user input. For more information, see [Introduction to the Validation Controls](https://docs.microsoft.com/previous-versions/dotnet/netframework-3.0/2e4hd649(v=vs.85)).
<a name="data_operations"></a>
## Data Operations
When the <xref:System.Web.UI.WebControls.ListView> control is bound to a data source control, the <xref:System.Web.UI.WebControls.ListView> control can take advantage of the data source control's capabilities and provide automatic sort, insert, update, and delete functionality.
> [!NOTE]
> The <xref:System.Web.UI.WebControls.ListView> control can provide support for sorting, inserting, updating, and deleting with other types of data sources. However, in order to implement these operations, you must create code in an appropriate event handler.
Because the <xref:System.Web.UI.WebControls.ListView> control uses templates, it does not provide a way to automatically generate buttons to perform update, delete, insert, sort, or select operations. You must manually include these buttons in the appropriate template. The <xref:System.Web.UI.WebControls.ListView> control recognizes certain buttons whose <xref:System.Web.UI.WebControls.Button.CommandName%2A> property is set to a specific value. The following table lists the buttons that the <xref:System.Web.UI.WebControls.ListView> control recognizes and their functions.
|Button|CommandName value|Description|
|------------|-----------------------|-----------------|
|Cancel|"Cancel"|Cancels an edit or insert operation. Raises the <xref:System.Web.UI.WebControls.ListView.ItemCanceling> event.|
|Delete|"Delete"|Deletes the current record from the data source. Raises the <xref:System.Web.UI.WebControls.ListView.ItemDeleted> and <xref:System.Web.UI.WebControls.ListView.ItemDeleting> events.|
|Select|"Select"|Sets the <xref:System.Web.UI.WebControls.ListView.SelectedIndex%2A> property to the <xref:System.Web.UI.WebControls.ListViewDataItem.DisplayIndex%2A> property value for the item. Renders the <xref:System.Web.UI.WebControls.ListView.SelectedItemTemplate%2A> template for the item. Raises the <xref:System.Web.UI.WebControls.ListView.SelectedIndexChanging> and <xref:System.Web.UI.WebControls.ListView.SelectedIndexChanged> events.|
|Edit|"Edit"|Puts the item in edit mode. Renders the <xref:System.Web.UI.WebControls.ListView.EditItemTemplate%2A> template for the item. Raises the <xref:System.Web.UI.WebControls.ListView.ItemEditing> event.|
|Insert|"Insert"|Inserts the bound values from the <xref:System.Web.UI.WebControls.ListView.InsertItemTemplate%2A> template into the data source. Raises the <xref:System.Web.UI.WebControls.ListView.ItemInserting> and <xref:System.Web.UI.WebControls.ListView.ItemInserted> events.|
|Update|"Update"|Updates the current record in the data source with the bound values from the <xref:System.Web.UI.WebControls.ListView.EditItemTemplate%2A> template. Raises the <xref:System.Web.UI.WebControls.ListView.ItemUpdating> and <xref:System.Web.UI.WebControls.ListView.ItemUpdated> events.|
|Sort|"Sort"|Sorts the columns listed in the `CommandArgument` property of the button. Raises the <xref:System.Web.UI.WebControls.ListView.Sorting> and <xref:System.Web.UI.WebControls.ListView.Sorted> events.|
Unlike the Delete button (which deletes the current data item immediately), when the Edit button is clicked, the <xref:System.Web.UI.WebControls.ListView> control displays the current item in edit mode. In edit mode, the content that is contained in the <xref:System.Web.UI.WebControls.ListView.EditItemTemplate%2A> property is displayed for the current data item. Typically, in the edit item template, 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 <xref:System.Web.UI.WebControls.CheckBox> control) also usually display a field's value for a user to modify. Clicking the Update button updates the record in the data source, and clicking the Cancel button cancels the edit operation.
The insert functionality is enabled when the <xref:System.Web.UI.WebControls.ListView.InsertItemPosition%2A> property is set to <xref:System.Web.UI.WebControls.InsertItemPosition.FirstItem> or <xref:System.Web.UI.WebControls.InsertItemPosition.LastItem>. This property defines where the <xref:System.Web.UI.WebControls.ListView.InsertItemTemplate%2A> template is rendered for the insert item. The insert item template typically includes an Insert and a Cancel button, and empty input controls are displayed for users to enter the values for the new record. Clicking the Insert button inserts the record in the data source, and clicking the Cancel button clears all the fields.
### Sorting
The <xref:System.Web.UI.WebControls.ListView> control enables users to sort the items by clicking the Sort button. Sort functionality is defined in the `CommandArgument` property of the button that contains the columns to be sorted.
### Paging
Instead of displaying all the records from the data source at the same time, the <xref:System.Web.UI.WebControls.ListView> control can break the records into pages. To enable paging, associate a <xref:System.Web.UI.WebControls.DataPager> control with the <xref:System.Web.UI.WebControls.ListView> control. Then insert a <xref:System.Web.UI.WebControls.DataPager> control inside the <xref:System.Web.UI.WebControls.ListView.LayoutTemplate%2A> template. Alternatively, if the <xref:System.Web.UI.WebControls.DataPager> control is outside the <xref:System.Web.UI.WebControls.ListView> control, set the <xref:System.Web.UI.WebControls.DataPager.PagedControlID%2A> property to the <xref:System.Web.UI.Control.ID%2A> of the <xref:System.Web.UI.WebControls.ListView> control.
<a name="Events"></a>
## Events
The following table lists the events that are supported by the <xref:System.Web.UI.WebControls.ListView> control.
|Event|Description|
|-----------|-----------------|
|<xref:System.Web.UI.WebControls.ListView.ItemCanceling>|Occurs when the Cancel button (a button with its `CommandName` property set to "Cancel") is clicked, but before the <xref:System.Web.UI.WebControls.ListView> control cancels the insert or edit operation. This event is often used to stop the cancel operation.|
|<xref:System.Web.UI.WebControls.ListView.ItemCommand>|Occurs when a button is clicked in the <xref:System.Web.UI.WebControls.ListView> control. This event is often used to perform a custom task when a button is clicked in the control.|
|<xref:System.Web.UI.WebControls.ListView.ItemCreated>|Occurs when a new item is created in the <xref:System.Web.UI.WebControls.ListView> control. This event is often used to modify the content of an item when the item is created.|
|<xref:System.Web.UI.WebControls.ListView.ItemDataBound>|Occurs when a data item is bound to data in the <xref:System.Web.UI.WebControls.ListView> control. This event is often used to modify the content of an item when the item is bound to data.|
|<xref:System.Web.UI.WebControls.ListView.ItemDeleted>|Occurs when a Delete button (a button with its `CommandName` property set to "Delete") is clicked or the <xref:System.Web.UI.WebControls.ListView.DeleteItem%2A> method is called, after the <xref:System.Web.UI.WebControls.ListView> 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.ListView.ItemDeleting>|Occurs when a Delete button (a button with its `CommandName` property set to "Delete") is clicked or the <xref:System.Web.UI.WebControls.ListView.DeleteItem%2A> method is called, but before the <xref:System.Web.UI.WebControls.ListView> control deletes the record from the data source. This event is often used to confirm or cancel the delete operation.|
|<xref:System.Web.UI.WebControls.ListView.ItemEditing>|Occurs when an Edit button (a button with its `CommandName` property set to "Edit") is clicked, but before the <xref:System.Web.UI.WebControls.ListView> control enters edit mode. This event is often used to cancel the editing operation.|
|<xref:System.Web.UI.WebControls.ListView.ItemInserted>|Occurs when an Insert button (a button with its `CommandName` property set to "Insert") is clicked or the <xref:System.Web.UI.WebControls.ListView.InsertNewItem%2A> method is called, after the <xref:System.Web.UI.WebControls.ListView> control inserts the new record from the data source. This event is often used to check the results of the insert operation.|
|<xref:System.Web.UI.WebControls.ListView.ItemInserting>|Occurs when an Insert button (a button with its `CommandName` property set to "Insert") is clicked or the <xref:System.Web.UI.WebControls.ListView.InsertNewItem%2A> method is called, but before the <xref:System.Web.UI.WebControls.ListView> control inserts the record. This event is often used to cancel the insert operation or change or validate the values of the new item.|
|<xref:System.Web.UI.WebControls.ListView.ItemUpdated>|Occurs when an Update button (a button with its `CommandName` property set to "Update") is clicked or the <xref:System.Web.UI.WebControls.ListView.UpdateItem%2A> method is called, after the <xref:System.Web.UI.WebControls.ListView> control updates the record. This event is often used to check the results of the update operation.|
|<xref:System.Web.UI.WebControls.ListView.ItemUpdating>|Occurs when an Update button (a button with its `CommandName` property set to "Update") is clicked or the <xref:System.Web.UI.WebControls.ListView.UpdateItem%2A> method is called, but before the <xref:System.Web.UI.WebControls.ListView> control updates the record. This event is often used to cancel the updating operation or change or validate the values of the edited item.|
|<xref:System.Web.UI.WebControls.ListView.LayoutCreated>|Occurs when the <xref:System.Web.UI.WebControls.ListView.LayoutTemplate%2A> template is created in a <xref:System.Web.UI.WebControls.ListView> control. This event is often used to perform a task after the template is created.|
|<xref:System.Web.UI.WebControls.ListView.PagePropertiesChanged>|Occurs when the page properties change, after the <xref:System.Web.UI.WebControls.ListView> control sets the new values.|
|<xref:System.Web.UI.WebControls.ListView.PagePropertiesChanging>|Occurs when the data-page properties change, but before the <xref:System.Web.UI.WebControls.ListView> control sets the new values.|
|<xref:System.Web.UI.WebControls.ListView.SelectedIndexChanged>|Occurs when a Select button (a button with its `CommandName` property set to "Select") is clicked, after the <xref:System.Web.UI.WebControls.ListView> control handles the select operation. This event is often used to perform a custom task after an item is selected in the control.|
|<xref:System.Web.UI.WebControls.ListView.SelectedIndexChanging>|Occurs when a Select button (a button with its `CommandName` property set to "Select") is clicked, but before the <xref:System.Web.UI.WebControls.ListView> control handles the select operation. This event is often used to cancel the select operation.|
|<xref:System.Web.UI.WebControls.ListView.Sorted>|Occurs when a Sort button (a button with its `CommandName` property set to "Sort") is clicked or the <xref:System.Web.UI.WebControls.ListView.Sort%2A> method is called, after the <xref:System.Web.UI.WebControls.ListView> control handles the sort operation. This event is typically used to perform a custom task after a user clicks a Sort button and the data has been sorted.|
|<xref:System.Web.UI.WebControls.ListView.Sorting>|Occurs when a Sort button (a button with its `CommandName` property set to "Sort") is clicked or the <xref:System.Web.UI.WebControls.ListView.Sort%2A> method is called, but before the <xref:System.Web.UI.WebControls.ListView> control handles the sort operation. This event is often used to cancel the sorting operation or to perform a custom sorting routine.|
<a name="declarative_syntax"></a>
## Declarative Syntax
```
<asp:ListView
    ConvertEmptyStringToNull="True|False"
DataKeyNames="string"
    DataMember="string"
    DataSource="string"
    DataSourceID="string"
    EditIndex="integer"
    Enabled="True|False"
    EnableTheming="True|False"
    EnableViewState="True|False"
    GroupPlaceholderID="string"
    GroupItemCount="integer"
    ID="string"
    InsertItemPosition="None|FirstItem|LastItem"
    ItemPlaceholderID="string"
    OnDataBinding="DataBinding event handler"
    OnDataBound="DataBound event handler"
    OnDisposed="Disposed event handler"
    OnInit="Init event handler"
    OnItemCanceling="ItemCanceling event handler"
    OnItemCommand="ItemCommand event handler"
    OnItemCreated="ItemCreated event handler"
    OnItemDataBound="ItemDataBound event handler"
    OnItemDeleted="ItemDeleted event handler"
    OnItemDeleting="ItemDeleting event handler"
    OnItemEditing="ItemEditing event handler"
    OnItemInserted="ItemInserted event handler"
    OnItemInserting="ItemInserting event handler"
    OnItemUpdated="ItemUpdated event handler"
    OnItemUpdating="ItemUpdating event handler"
    OnLayoutCreated="LayoutCreated event handler"
    OnLoad="Load event handler"
    OnPagePropertiesChanged="PagePropertiesChanged event handler"
    OnPagePropertiesChanging="PagePropertiesChanging event handler"
    OnPreRender="PreRender event handler"
    OnSelectedIndexChanged="SelectedIndexChanged event handler"
    OnSelectedIndexChanging="SelectedIndexChanging event handler"
    OnSorted="Sorted event handler"
    OnSorting="Sorting event handler"
    OnUnload="Unload event handler"
    runat="server"
    SelectedIndex="integer"
    SkinID="string"
    Style="string"
    Visible="True|False"
>
        <AlternatingItemTemplate>
            <!-- child controls -->
        </AlternatingItemTemplate>
        <EditItemTemplate>
            <!-- child controls -->
        </EditItemTemplate>
        <EmptyDataTemplate>
            <!-- child controls -->
        </EmptyDataTemplate>
        <EmptyItemTemplate>
            <!-- child controls -->
        </EmptyItemTemplate>
        <GroupSeparatorTemplate>
            <!-- child controls -->
        </GroupSeparatorTemplate>
        <GroupTemplate>
            <!-- child controls -->
        </GroupTemplate>
        <InsertItemTemplate>
            <!-- child controls -->
        </InsertItemTemplate>
        <ItemSeparatorTemplate>
            <!-- child controls -->
        </ItemSeparatorTemplate>
        <ItemTemplate>
            <!-- child controls -->
        </ItemTemplate>
        <LayoutTemplate>
                <!-- child controls -->
        </LayoutTemplate>
        <SelectedItemTemplate>
            <!-- child controls -->
        </SelectedItemTemplate>
</asp:ListView>
```
## Examples
The following example shows how to use the <xref:System.Web.UI.WebControls.ListView> control to display records from a database by using an HTML table. The values are retrieved by using a <xref:System.Web.UI.WebControls.LinqDataSource> control.
[!code-aspx-csharp[System.Web.UI.WebControls.ListView_Simple#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView_Simple/CS/ListViewSimpleCS.aspx#1)]
[!code-aspx-vb[System.Web.UI.WebControls.ListView_Simple#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView_Simple/VB/ListViewSimpleVB.aspx#1)]
The following example shows how to use the <xref:System.Web.UI.WebControls.ListView> control to display values in a flow layout by using the `div` element. The values are retrieved by using a <xref:System.Web.UI.WebControls.SqlDataSource> control.
[!code-aspx-csharp[System.Web.UI.WebControls.ListView_FlowLayout#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView_FlowLayout/CS/ListViewFlowLayoutCS.aspx#1)]
[!code-aspx-vb[System.Web.UI.WebControls.ListView_FlowLayout#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView_FlowLayout/VB/ListViewFlowLayoutVB.aspx#1)]
The following example shows how to use the <xref:System.Web.UI.WebControls.ListView> control to insert, delete, and update records.
> [!IMPORTANT]
> This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see [Script Exploits Overview](https://msdn.microsoft.com/library/772c7312-211a-4eb3-8d6e-eec0aa1dcc07).
[!code-aspx-csharp[System.Web.UI.WebControls.ListView_Edit#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView_Edit/CS/ListViewEditCS.aspx#1)]
[!code-aspx-vb[System.Web.UI.WebControls.ListView_Edit#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView_Edit/VB/ListViewEditVB.aspx#1)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.LinqDataSource" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
<related type="Article" href="https://msdn.microsoft.com/library/f9cf026e-d8b8-49f8-a3c4-64de2edbbb96">ASP.NET Data-Bound Web Server Controls Overview</related>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ListView ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.ListView.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; ListView();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Web.UI.WebControls.ListView" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use this constructor to initialize a new instance of the <xref:System.Web.UI.WebControls.ListView> class. To dynamically add a <xref:System.Web.UI.WebControls.ListView> control to a page, create a new <xref:System.Web.UI.WebControls.ListView> 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 a <xref:System.Web.UI.WebControls.PlaceHolder> control.
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.Control.Controls" />
<altmember cref="T:System.Web.UI.WebControls.PlaceHolder" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="AccessKey">
<MemberSignature Language="C#" Value="public override string AccessKey { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string AccessKey" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.AccessKey" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property AccessKey As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::String ^ AccessKey { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.AccessKey : string with get, set" Usage="System.Web.UI.WebControls.ListView.AccessKey" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.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>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Overrides the <see cref="P:System.Web.UI.WebControls.WebControl.AccessKey" /> property. Setting this property is not supported by the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<value>
<see cref="F:System.String.Empty" />, which indicates that the property is not set.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Style properties are not supported by the <xref:System.Web.UI.WebControls.ListView> control. If you try to set the <xref:System.Web.UI.WebControls.ListView.AccessKey%2A> property, a <xref:System.NotSupportedException> exception is thrown. If you get the property, it returns the default value of the corresponding property of the base class.
To style the <xref:System.Web.UI.WebControls.ListView> control, you must style the controls inside the <xref:System.Web.UI.WebControls.ListView> templates by using cascading style sheets (CSS) classes or inline style elements.
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">An attempt was made to set the <see cref="P:System.Web.UI.WebControls.ListView.AccessKey" /> property.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="AddControlToContainer">
<MemberSignature Language="C#" Value="protected virtual void AddControlToContainer (System.Web.UI.Control control, System.Web.UI.Control container, int addLocation);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void AddControlToContainer(class System.Web.UI.Control control, class System.Web.UI.Control container, int32 addLocation) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.ListView.AddControlToContainer(System.Web.UI.Control,System.Web.UI.Control,System.Int32)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void AddControlToContainer(System::Web::UI::Control ^ control, System::Web::UI::Control ^ container, int addLocation);" />
<MemberSignature Language="F#" Value="abstract member AddControlToContainer : System.Web.UI.Control * System.Web.UI.Control * int -&gt; unit&#xA;override this.AddControlToContainer : System.Web.UI.Control * System.Web.UI.Control * int -&gt; unit" Usage="listView.AddControlToContainer (control, container, addLocation)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="control" Type="System.Web.UI.Control" />
<Parameter Name="container" Type="System.Web.UI.Control" />
<Parameter Name="addLocation" Type="System.Int32" />
</Parameters>
<Docs>
<param name="control">An object that contains the controls to be added to the container.</param>
<param name="container">The container that is used to store the child controls.</param>
<param name="addLocation">The location in the controls collection at which to add the child control.</param>
<summary>Adds the specified control to the specified container.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.ListView.AddControlToContainer%2A> method is a helper method that is called by the <xref:System.Web.UI.WebControls.ListView> control to add a control to the specified container.
> [!NOTE]
> This method is primarily used by control developers to extend the <xref:System.Web.UI.WebControls.ListView> control.
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.Control" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="AlternatingItemTemplate">
<MemberSignature Language="C#" Value="public virtual System.Web.UI.ITemplate AlternatingItemTemplate { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.ITemplate AlternatingItemTemplate" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.AlternatingItemTemplate" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property AlternatingItemTemplate As ITemplate" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Web::UI::ITemplate ^ AlternatingItemTemplate { System::Web::UI::ITemplate ^ get(); void set(System::Web::UI::ITemplate ^ value); };" />
<MemberSignature Language="F#" Value="member this.AlternatingItemTemplate : System.Web.UI.ITemplate with get, set" Usage="System.Web.UI.WebControls.ListView.AlternatingItemTemplate" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.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.ListViewDataItem), System.ComponentModel.BindingDirection.TwoWay)</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 custom content for the alternating data item in a <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<value>An object that contains the custom content for the alternating data item in a <see cref="T:System.Web.UI.WebControls.ListView" /> control. The default is <see langword="null" />, which indicates that this property is not set.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.ListView.AlternatingItemTemplate%2A> property to define a custom user interface (UI) for the alternating data item. The <xref:System.Web.UI.WebControls.ListView.AlternatingItemTemplate%2A> template usually contains the same controls and content as the <xref:System.Web.UI.WebControls.ListView.ItemTemplate%2A> template, but with a different appearance to distinguish items.
To specify the custom template declaratively, add an `AlternatingItemTemplate` element inside the <xref:System.Web.UI.WebControls.ListView> control. Then add controls and content between the opening and closing `<AlternatingItemTemplate>` tags. To display the field values from the data source, use a data-binding expression. For more information, see [Data-Binding Expressions Overview](https://msdn.microsoft.com/library/14cdd57d-0f82-4667-b503-73e1a96f136a).
To create buttons that automatically select, delete, and edit operations, add a button control to the template. Set its <xref:System.Web.UI.WebControls.Button.CommandName%2A> property to one of the values listed in the following table.
|Button type|CommandName value|
|-----------------|-----------------------|
|Delete|"Delete"|
|Edit|"Edit"|
|Select|"Select"|
## Examples
The following example shows how to use the <xref:System.Web.UI.WebControls.ListView.AlternatingItemTemplate%2A> template to define the style for alternating data items in a <xref:System.Web.UI.WebControls.ListView> control.
[!code-aspx-csharp[System.Web.UI.WebControls.ListView.AlternatingItemTemplate#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.AlternatingItemTemplate/CS/ListViewAlternatingItemTemplateCS.aspx#1)]
[!code-aspx-vb[System.Web.UI.WebControls.ListView.AlternatingItemTemplate#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.AlternatingItemTemplate/VB/ListViewAlternatingItemTemplateVB.aspx#1)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.ListView.GroupTemplate" />
<altmember cref="P:System.Web.UI.WebControls.ListView.ItemTemplate" />
<altmember cref="P:System.Web.UI.WebControls.ListView.LayoutTemplate" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
<related type="Article" href="https://msdn.microsoft.com/library/14cdd57d-0f82-4667-b503-73e1a96f136a">Data-Binding Expression Syntax</related>
</Docs>
</Member>
<Member MemberName="BackColor">
<MemberSignature Language="C#" Value="public override System.Drawing.Color BackColor { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Color BackColor" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.BackColor" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property BackColor As Color" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Drawing::Color BackColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };" />
<MemberSignature Language="F#" Value="member this.BackColor : System.Drawing.Color with get, set" Usage="System.Web.UI.WebControls.ListView.BackColor" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.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>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Drawing.Color</ReturnType>
</ReturnValue>
<Docs>
<summary>Overrides the <see cref="P:System.Web.UI.WebControls.WebControl.BackColor" /> property. Setting this property is not supported by the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<value>
<see cref="F:System.Drawing.Color.Empty" />, which indicates that the property is not set.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Style properties are not supported by the <xref:System.Web.UI.WebControls.ListView> control. If you try to set the <xref:System.Web.UI.WebControls.ListView.BackColor%2A> property, a <xref:System.NotSupportedException> exception is thrown. If you get the property, it returns the default value of the corresponding property of the base class.
To style the <xref:System.Web.UI.WebControls.ListView> control, you must style the controls inside the <xref:System.Web.UI.WebControls.ListView> templates by using cascading style sheets (CSS) classes or inline style elements.
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">An attempt was made to set the <see cref="P:System.Web.UI.WebControls.ListView.BackColor" /> property.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="BorderColor">
<MemberSignature Language="C#" Value="public override System.Drawing.Color BorderColor { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Color BorderColor" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.BorderColor" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property BorderColor As Color" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Drawing::Color BorderColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };" />
<MemberSignature Language="F#" Value="member this.BorderColor : System.Drawing.Color with get, set" Usage="System.Web.UI.WebControls.ListView.BorderColor" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.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>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Drawing.Color</ReturnType>
</ReturnValue>
<Docs>
<summary>Overrides the <see cref="P:System.Web.UI.WebControls.WebControl.BorderColor" /> property. Setting this property is not supported by the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<value>
<see cref="F:System.Drawing.Color.Empty" />, which indicates that the property is not set.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Style properties are not supported by the <xref:System.Web.UI.WebControls.ListView> control. If you try to set the <xref:System.Web.UI.WebControls.ListView.BorderColor%2A> property, a <xref:System.NotSupportedException> exception is thrown. If you get the property, it returns the default value of the corresponding property of the base class.
To style the <xref:System.Web.UI.WebControls.ListView> control, you must style the controls inside the <xref:System.Web.UI.WebControls.ListView> templates by using cascading style sheets (CSS) classes or inline style elements.
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">An attempt was made to set the <see cref="P:System.Web.UI.WebControls.ListView.BorderColor" /> property.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="BorderStyle">
<MemberSignature Language="C#" Value="public override System.Web.UI.WebControls.BorderStyle BorderStyle { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Web.UI.WebControls.BorderStyle BorderStyle" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.BorderStyle" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property BorderStyle As BorderStyle" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Web::UI::WebControls::BorderStyle BorderStyle { System::Web::UI::WebControls::BorderStyle get(); void set(System::Web::UI::WebControls::BorderStyle value); };" />
<MemberSignature Language="F#" Value="member this.BorderStyle : System.Web.UI.WebControls.BorderStyle with get, set" Usage="System.Web.UI.WebControls.ListView.BorderStyle" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.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>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.BorderStyle</ReturnType>
</ReturnValue>
<Docs>
<summary>Overrides the <see cref="P:System.Web.UI.WebControls.WebControl.BorderStyle" /> property. Setting this property is not supported by the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<value>
<see cref="F:System.Web.UI.WebControls.BorderStyle.NotSet" />, which indicates that the property is not set.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Style properties are not supported by the <xref:System.Web.UI.WebControls.ListView> control. If you try to set the <xref:System.Web.UI.WebControls.ListView.BorderStyle%2A> property, a <xref:System.NotSupportedException> exception is thrown. If you get the property, it returns the default value of the corresponding property of the base class.
To style the <xref:System.Web.UI.WebControls.ListView> control, you must style the controls inside the <xref:System.Web.UI.WebControls.ListView> templates by using cascading style sheets (CSS) classes or inline style elements.
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">An attempt was made to set the <see cref="P:System.Web.UI.WebControls.ListView.BorderStyle" /> property.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="BorderWidth">
<MemberSignature Language="C#" Value="public override System.Web.UI.WebControls.Unit BorderWidth { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Web.UI.WebControls.Unit BorderWidth" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.BorderWidth" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property BorderWidth As Unit" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Web::UI::WebControls::Unit BorderWidth { System::Web::UI::WebControls::Unit get(); void set(System::Web::UI::WebControls::Unit value); };" />
<MemberSignature Language="F#" Value="member this.BorderWidth : System.Web.UI.WebControls.Unit with get, set" Usage="System.Web.UI.WebControls.ListView.BorderWidth" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.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>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.Unit</ReturnType>
</ReturnValue>
<Docs>
<summary>Overrides the <see cref="P:System.Web.UI.WebControls.WebControl.BorderWidth" /> property. Setting this property is not supported by the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<value>
<see cref="F:System.Web.UI.WebControls.Unit.Empty" />, which indicates that this property is not set.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Style properties are not supported by the <xref:System.Web.UI.WebControls.ListView> control. If you try to set the <xref:System.Web.UI.WebControls.ListView.BorderWidth%2A> property, a <xref:System.NotSupportedException> exception is thrown. If you get the property, it returns the default value of the corresponding property of the base class.
To style the <xref:System.Web.UI.WebControls.ListView> control, you must style the controls inside the <xref:System.Web.UI.WebControls.ListView> templates by using cascading style sheets (CSS) classes or inline style elements.
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">An attempt was made to set the <see cref="P:System.Web.UI.WebControls.ListView.BorderWidth" /> property.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="ClientIDRowSuffix">
<MemberSignature Language="C#" Value="public virtual string[] ClientIDRowSuffix { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string[] ClientIDRowSuffix" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.ClientIDRowSuffix" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property ClientIDRowSuffix As String()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property cli::array &lt;System::String ^&gt; ^ ClientIDRowSuffix { cli::array &lt;System::String ^&gt; ^ get(); void set(cli::array &lt;System::String ^&gt; ^ value); };" />
<MemberSignature Language="F#" Value="member this.ClientIDRowSuffix : string[] with get, set" Usage="System.Web.UI.WebControls.ListView.ClientIDRowSuffix" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Web.UI.WebControls.IDataBoundListControl.ClientIDRowSuffix</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<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(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.TypeConverter(typeof(System.Web.UI.WebControls.StringArrayConverter))</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.WebCategory("Data")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String[]</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the name of the data field whose value is used to uniquely identify each data row of a <see cref="T:System.Web.UI.WebControls.ListView" /> control when the <see cref="P:System.Web.UI.Control.ClientIDMode" /> property is set to <see cref="F:System.Web.UI.ClientIDMode.Predictable" />.</summary>
<value>The name of the data field whose value is used to uniquely identify each instance of a <see cref="T:System.Web.UI.WebControls.ListView" /> control when ASP.NET generates the <see cref="P:System.Web.UI.Control.ClientID" /> value.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
To prevent naming conflicts when multiple instances of a control are rendered in multiple rows of a <xref:System.Web.UI.WebControls.ListView> control, ASP.NET generates a unique <xref:System.Web.UI.Control.ClientID%2A> value for each instance of the control. You specify how the <xref:System.Web.UI.Control.ClientID%2A> value is generated by setting the <xref:System.Web.UI.Control.ClientIDMode%2A> property. If you set the <xref:System.Web.UI.Control.ClientIDMode%2A> property to <xref:System.Web.UI.ClientIDMode.Predictable>, ASP.NET generates the <xref:System.Web.UI.Control.ClientID%2A> by appending a suffix that is derived from the data field specified in <xref:System.Web.UI.WebControls.GridView.ClientIDRowSuffix%2A>. If <xref:System.Web.UI.WebControls.GridView.ClientIDRowSuffix%2A> is not set, the suffix is a sequential number.
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.Control.ClientIDMode" />
<related type="Article" href="https://msdn.microsoft.com/library/45a8c3ef-5ac7-48f1-862a-0cd5073742e7">ASP.NET Control Identification</related>
<related type="Article" href="https://msdn.microsoft.com/library/fb58ed73-d8f7-401c-9560-d99dd9ca7db8">How to: Access Controls from JavaScript by ID</related>
<related type="Article" href="https://msdn.microsoft.com/library/776f3747-7fa7-4851-ae27-f728ede1a564">Walkthrough: Making Data-Bound Controls Easier to Access from JavaScript</related>
<related type="Article" href="https://msdn.microsoft.com/library/f0eaf202-61b6-4cd8-9604-6b7638fdf0ae">Walkthrough: Making Controls Located in Web User Controls Easier to Access From JavaScript</related>
</Docs>
</Member>
<Member MemberName="ClientIDRowSuffixDataKeys">
<MemberSignature Language="C#" Value="public System.Web.UI.WebControls.DataKeyArray ClientIDRowSuffixDataKeys { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.WebControls.DataKeyArray ClientIDRowSuffixDataKeys" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.ClientIDRowSuffixDataKeys" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property ClientIDRowSuffixDataKeys As DataKeyArray" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Web::UI::WebControls::DataKeyArray ^ ClientIDRowSuffixDataKeys { System::Web::UI::WebControls::DataKeyArray ^ get(); };" />
<MemberSignature Language="F#" Value="member this.ClientIDRowSuffixDataKeys : System.Web.UI.WebControls.DataKeyArray" Usage="System.Web.UI.WebControls.ListView.ClientIDRowSuffixDataKeys" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Web.UI.IDataKeysControl.ClientIDRowSuffixDataKeys</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<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.Browsable(false)</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.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.DataKeyArray</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the data values that are used to uniquely identify each instance of a data-bound control when ASP.NET generates the <see cref="P:System.Web.UI.Control.ClientID" /> value.</summary>
<value>The data values that are used to uniquely identify each instance of a data-bound control when ASP.NET generates the <see cref="P:System.Web.UI.Control.ClientID" /> value.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Controls">
<MemberSignature Language="C#" Value="public override System.Web.UI.ControlCollection Controls { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.ControlCollection Controls" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.Controls" />
<MemberSignature Language="VB.NET" Value="Public Overrides ReadOnly Property Controls As ControlCollection" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Web::UI::ControlCollection ^ Controls { System::Web::UI::ControlCollection ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Controls : System.Web.UI.ControlCollection" Usage="System.Web.UI.WebControls.ListView.Controls" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.UI.ControlCollection</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a <see cref="T:System.Web.UI.ControlCollection" /> object that represents the child controls of the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<value>The collection of child controls for the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.ListView.Controls%2A> property overrides the base implementation. This guarantees that all child controls have been created before the property returns the <xref:System.Web.UI.ControlCollection> object.
The <xref:System.Web.UI.Control.Controls%2A> property enables you to programmatically access the instance of the <xref:System.Web.UI.ControlCollection> class for the <xref:System.Web.UI.WebControls.ListView> control. You can add controls to the collection, remove controls from the collection, or iterate through the server controls in the collection.
To access a specific child control of the <xref:System.Web.UI.WebControls.ListView> control, you can use the <xref:System.Web.UI.Control.FindControl%2A> method.
]]></format>
</remarks>
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="ConvertEmptyStringToNull">
<MemberSignature Language="C#" Value="public virtual bool ConvertEmptyStringToNull { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool ConvertEmptyStringToNull" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.ConvertEmptyStringToNull" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property ConvertEmptyStringToNull As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property bool ConvertEmptyStringToNull { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.ConvertEmptyStringToNull : bool with get, set" Usage="System.Web.UI.WebControls.ListView.ConvertEmptyStringToNull" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Category("Behavior")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value that indicates whether empty string values ("") are automatically converted to null values when the data field is updated in the data source.</summary>
<value>
<see langword="true" /> if empty string values are automatically converted to null values; otherwise, <see langword="false" />. The default is <see langword="true" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.Parameter> object of the data source control that the <xref:System.Web.UI.WebControls.ListView> control is bound to also has a property named <xref:System.Web.UI.WebControls.Parameter.ConvertEmptyStringToNull%2A?displayProperty=nameWithType>. This property performs the same function. Make sure that both properties are set appropriately.
]]></format>
</remarks>
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
<related type="Article" href="https://msdn.microsoft.com/library/5436e8f6-171a-4361-a9a3-cec826a08c91">Handling Null Database Values Using Data Source Controls</related>
</Docs>
</Member>
<MemberGroup MemberName="CreateChildControls">
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Creates the control hierarchy that is used to render the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</MemberGroup>
<Member MemberName="CreateChildControls">
<MemberSignature Language="C#" Value="protected internal override void CreateChildControls ();" />
<MemberSignature Language="ILAsm" Value=".method familyorassemblyhidebysig virtual instance void CreateChildControls() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.ListView.CreateChildControls" />
<MemberSignature Language="VB.NET" Value="Protected Friend Overrides Sub CreateChildControls ()" />
<MemberSignature Language="C++ CLI" Value="protected public:&#xA; override void CreateChildControls();" />
<MemberSignature Language="F#" Value="override this.CreateChildControls : unit -&gt; unit" Usage="listView.CreateChildControls " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates the control hierarchy that is used to render the <see cref="T:System.Web.UI.WebControls.ListView" /> control, based on the values that are stored in view state.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.ListView.CreateChildControls> method is a helper method that is used by the <xref:System.Web.UI.WebControls.ListView> class to create the control hierarchy. This overload of the method creates the control hierarchy based on values from view state, instead of directly from the data source.
]]></format>
</remarks>
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="CreateChildControls">
<MemberSignature Language="C#" Value="protected virtual int CreateChildControls (System.Collections.IEnumerable dataSource, bool dataBinding);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance int32 CreateChildControls(class System.Collections.IEnumerable dataSource, bool dataBinding) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.ListView.CreateChildControls(System.Collections.IEnumerable,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function CreateChildControls (dataSource As IEnumerable, dataBinding As Boolean) As Integer" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual int CreateChildControls(System::Collections::IEnumerable ^ dataSource, bool dataBinding);" />
<MemberSignature Language="F#" Value="override this.CreateChildControls : System.Collections.IEnumerable * bool -&gt; int" Usage="listView.CreateChildControls (dataSource, dataBinding)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.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 object that contains the data source for the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</param>
<param name="dataBinding">
<see langword="true" /> to indicate that the child controls are bound to data; <see langword="false" /> to indicate that the control will re-create itself from view state during a postback.</param>
<summary>Creates the control hierarchy that is used to render the <see cref="T:System.Web.UI.WebControls.ListView" /> control by using the specified data source.</summary>
<returns>The number of items that are created.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.ListView.CreateChildControls%2A> method is used to create the control hierarchy of the <xref:System.Web.UI.WebControls.ListView> control.
> [!NOTE]
> This method is primarily used by control developers to extend the <xref:System.Web.UI.WebControls.ListView> control.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
<paramref name="dataSource" /> returns <see langword="null" /> for <see cref="T:System.Web.UI.DataSourceView" />.
-or-
<paramref name="dataSource" /> does not implement the <see cref="T:System.Collections.ICollection" /> interface and cannot return a <see cref="P:System.Web.UI.DataSourceSelectArguments.TotalRowCount" /> value.
-or-
<paramref name="dataSource" /> does not implement the <see cref="T:System.Collections.ICollection" /> interface and <paramref name="dataBinding" /> is set to <see langword="false" />.
-or-
The <see cref="T:System.Web.UI.WebControls.ListView" /> control does not have a group placeholder specified.
-or-
The <see cref="T:System.Web.UI.WebControls.ListView" /> control does not have an item placeholder specified.</exception>
<altmember cref="T:System.Collections.IEnumerable" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</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.ListView.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="listView.CreateControlStyle " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.Style</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates the default style for the control.</summary>
<returns>The style for the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Style properties are not supported by the <xref:System.Web.UI.WebControls.ListView> control. If you try to call the <xref:System.Web.UI.WebControls.ListView.CreateControlStyle%2A> method, a <xref:System.NotSupportedException> exception is thrown.
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">An attempt was made to invoke the <see cref="M:System.Web.UI.WebControls.ListView.CreateControlStyle" /> method.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="CreateDataItem">
<MemberSignature Language="C#" Value="protected virtual System.Web.UI.WebControls.ListViewDataItem CreateDataItem (int dataItemIndex, int displayIndex);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance class System.Web.UI.WebControls.ListViewDataItem CreateDataItem(int32 dataItemIndex, int32 displayIndex) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.ListView.CreateDataItem(System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function CreateDataItem (dataItemIndex As Integer, displayIndex As Integer) As ListViewDataItem" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Web::UI::WebControls::ListViewDataItem ^ CreateDataItem(int dataItemIndex, int displayIndex);" />
<MemberSignature Language="F#" Value="abstract member CreateDataItem : int * int -&gt; System.Web.UI.WebControls.ListViewDataItem&#xA;override this.CreateDataItem : int * int -&gt; System.Web.UI.WebControls.ListViewDataItem" Usage="listView.CreateDataItem (dataItemIndex, displayIndex)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.ListViewDataItem</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="dataItemIndex" Type="System.Int32" />
<Parameter Name="displayIndex" Type="System.Int32" />
</Parameters>
<Docs>
<param name="dataItemIndex">The index of the data item in the underlying data source object.</param>
<param name="displayIndex">The display index of the data item in the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</param>
<summary>Creates a data item in the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<returns>A data item that is created by using the specified parameters.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is primarily used by control developers to extend the <xref:System.Web.UI.WebControls.ListView> control.
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.ListViewDataItem" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</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.ListView.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="listView.CreateDataSourceSelectArguments " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.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 contains the arguments that are passed to the data source.</summary>
<returns>The arguments that are passed to the data source.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.ListView.CreateDataSourceSelectArguments%2A> method is a helper method that is called by the <xref:System.Web.UI.WebControls.ListView> control. In this implementation, the <xref:System.Web.UI.DataSourceSelectArguments> object contains the arguments for paging operations.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>When you extend the <see cref="T:System.Web.UI.WebControls.ListView" /> class, you can override this method and specify custom values that are passed to the data source.</para>
</block>
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="CreateEmptyDataItem">
<MemberSignature Language="C#" Value="protected virtual void CreateEmptyDataItem ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void CreateEmptyDataItem() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.ListView.CreateEmptyDataItem" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub CreateEmptyDataItem ()" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void CreateEmptyDataItem();" />
<MemberSignature Language="F#" Value="abstract member CreateEmptyDataItem : unit -&gt; unit&#xA;override this.CreateEmptyDataItem : unit -&gt; unit" Usage="listView.CreateEmptyDataItem " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates the <see cref="P:System.Web.UI.WebControls.ListView.EmptyDataTemplate" /> template in the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.ListView.CreateEmptyDataItem%2A> method is a helper method that is called by the <xref:System.Web.UI.WebControls.ListView> control to create the <xref:System.Web.UI.WebControls.ListView.EmptyDataTemplate%2A> template. The empty data template is displayed when the data source returns no records.
> [!NOTE]
> This method is primarily used by control developers to extend the <xref:System.Web.UI.WebControls.ListView> control.
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.ListView.EmptyDataTemplate" />
<altmember cref="M:System.Web.UI.WebControls.ListView.CreateItem(System.Web.UI.WebControls.ListViewItemType)" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="CreateEmptyItem">
<MemberSignature Language="C#" Value="protected virtual System.Web.UI.WebControls.ListViewItem CreateEmptyItem ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance class System.Web.UI.WebControls.ListViewItem CreateEmptyItem() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.ListView.CreateEmptyItem" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function CreateEmptyItem () As ListViewItem" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Web::UI::WebControls::ListViewItem ^ CreateEmptyItem();" />
<MemberSignature Language="F#" Value="abstract member CreateEmptyItem : unit -&gt; System.Web.UI.WebControls.ListViewItem&#xA;override this.CreateEmptyItem : unit -&gt; System.Web.UI.WebControls.ListViewItem" Usage="listView.CreateEmptyItem " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.ListViewItem</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates an empty item in the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<returns>The empty item that was created.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.ListView.CreateEmptyItem%2A> method is a helper method that is called by the <xref:System.Web.UI.WebControls.ListView> control to create an empty item. The empty item is displayed when the last group of a page of data in the <xref:System.Web.UI.WebControls.ListView> control does not have any more records to display.
> [!NOTE]
> This method is primarily used by control developers to extend the <xref:System.Web.UI.WebControls.ListView> control.
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.ListView.EmptyItemTemplate" />
<altmember cref="T:System.Web.UI.WebControls.ListViewItem" />
<altmember cref="P:System.Web.UI.WebControls.ListViewItem.ItemType" />
<altmember cref="T:System.Web.UI.WebControls.ListViewItemType" />
<altmember cref="M:System.Web.UI.WebControls.ListView.CreateItem(System.Web.UI.WebControls.ListViewItemType)" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="CreateInsertItem">
<MemberSignature Language="C#" Value="protected virtual System.Web.UI.WebControls.ListViewItem CreateInsertItem ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance class System.Web.UI.WebControls.ListViewItem CreateInsertItem() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.ListView.CreateInsertItem" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function CreateInsertItem () As ListViewItem" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Web::UI::WebControls::ListViewItem ^ CreateInsertItem();" />
<MemberSignature Language="F#" Value="abstract member CreateInsertItem : unit -&gt; System.Web.UI.WebControls.ListViewItem&#xA;override this.CreateInsertItem : unit -&gt; System.Web.UI.WebControls.ListViewItem" Usage="listView.CreateInsertItem " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.ListViewItem</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates an insert item in the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<returns>The insert item that was created.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.ListView.CreateInsertItem%2A> method is a helper method that is called by the <xref:System.Web.UI.WebControls.ListView> control to create an insert item. An insert item is a <xref:System.Web.UI.WebControls.ListViewItem> object whose <xref:System.Web.UI.WebControls.ListViewItem.ItemType%2A> is equal to <xref:System.Web.UI.WebControls.ListViewItemType.InsertItem?displayProperty=nameWithType>.
> [!NOTE]
> This method is primarily used by control developers to extend the <xref:System.Web.UI.WebControls.ListView> control.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">The <see cref="T:System.Web.UI.WebControls.ListView" /> control does not have an <see cref="P:System.Web.UI.WebControls.ListView.InsertItemTemplate" /> template specified.</exception>
<altmember cref="P:System.Web.UI.WebControls.ListView.InsertItemTemplate" />
<altmember cref="T:System.Web.UI.WebControls.ListViewItem" />
<altmember cref="P:System.Web.UI.WebControls.ListViewItem.ItemType" />
<altmember cref="T:System.Web.UI.WebControls.ListViewItemType" />
<altmember cref="M:System.Web.UI.WebControls.ListView.CreateItem(System.Web.UI.WebControls.ListViewItemType)" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="CreateItem">
<MemberSignature Language="C#" Value="protected virtual System.Web.UI.WebControls.ListViewItem CreateItem (System.Web.UI.WebControls.ListViewItemType itemType);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance class System.Web.UI.WebControls.ListViewItem CreateItem(valuetype System.Web.UI.WebControls.ListViewItemType itemType) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.ListView.CreateItem(System.Web.UI.WebControls.ListViewItemType)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function CreateItem (itemType As ListViewItemType) As ListViewItem" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Web::UI::WebControls::ListViewItem ^ CreateItem(System::Web::UI::WebControls::ListViewItemType itemType);" />
<MemberSignature Language="F#" Value="abstract member CreateItem : System.Web.UI.WebControls.ListViewItemType -&gt; System.Web.UI.WebControls.ListViewItem&#xA;override this.CreateItem : System.Web.UI.WebControls.ListViewItemType -&gt; System.Web.UI.WebControls.ListViewItem" Usage="listView.CreateItem itemType" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.ListViewItem</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="itemType" Type="System.Web.UI.WebControls.ListViewItemType" />
</Parameters>
<Docs>
<param name="itemType">One of the <see cref="T:System.Web.UI.WebControls.ListViewItemType" /> values.</param>
<summary>Creates a <see cref="T:System.Web.UI.WebControls.ListViewItem" /> object with the specified type.</summary>
<returns>A <see cref="T:System.Web.UI.WebControls.ListViewItem" /> object with the specified type.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.ListView.CreateItem%2A> method is a helper method that is called by the <xref:System.Web.UI.WebControls.ListView> control to create a <xref:System.Web.UI.WebControls.ListViewItem> object.
> [!NOTE]
> This method is primarily used by control developers to extend the <xref:System.Web.UI.WebControls.ListView> control.
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.ListViewItem" />
<altmember cref="T:System.Web.UI.WebControls.ListViewItemType" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="CreateItemsInGroups">
<MemberSignature Language="C#" Value="protected virtual System.Collections.Generic.IList&lt;System.Web.UI.WebControls.ListViewDataItem&gt; CreateItemsInGroups (System.Web.UI.WebControls.ListViewPagedDataSource dataSource, bool dataBinding, System.Web.UI.WebControls.InsertItemPosition insertPosition, System.Collections.ArrayList keyArray);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance class System.Collections.Generic.IList`1&lt;class System.Web.UI.WebControls.ListViewDataItem&gt; CreateItemsInGroups(class System.Web.UI.WebControls.ListViewPagedDataSource dataSource, bool dataBinding, valuetype System.Web.UI.WebControls.InsertItemPosition insertPosition, class System.Collections.ArrayList keyArray) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.ListView.CreateItemsInGroups(System.Web.UI.WebControls.ListViewPagedDataSource,System.Boolean,System.Web.UI.WebControls.InsertItemPosition,System.Collections.ArrayList)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function CreateItemsInGroups (dataSource As ListViewPagedDataSource, dataBinding As Boolean, insertPosition As InsertItemPosition, keyArray As ArrayList) As IList(Of ListViewDataItem)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Collections::Generic::IList&lt;System::Web::UI::WebControls::ListViewDataItem ^&gt; ^ CreateItemsInGroups(System::Web::UI::WebControls::ListViewPagedDataSource ^ dataSource, bool dataBinding, System::Web::UI::WebControls::InsertItemPosition insertPosition, System::Collections::ArrayList ^ keyArray);" />
<MemberSignature Language="F#" Value="abstract member CreateItemsInGroups : System.Web.UI.WebControls.ListViewPagedDataSource * bool * System.Web.UI.WebControls.InsertItemPosition * System.Collections.ArrayList -&gt; System.Collections.Generic.IList&lt;System.Web.UI.WebControls.ListViewDataItem&gt;&#xA;override this.CreateItemsInGroups : System.Web.UI.WebControls.ListViewPagedDataSource * bool * System.Web.UI.WebControls.InsertItemPosition * System.Collections.ArrayList -&gt; System.Collections.Generic.IList&lt;System.Web.UI.WebControls.ListViewDataItem&gt;" Usage="listView.CreateItemsInGroups (dataSource, dataBinding, insertPosition, keyArray)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Collections.Generic.IList&lt;System.Web.UI.WebControls.ListViewDataItem&gt;</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="dataSource" Type="System.Web.UI.WebControls.ListViewPagedDataSource" />
<Parameter Name="dataBinding" Type="System.Boolean" />
<Parameter Name="insertPosition" Type="System.Web.UI.WebControls.InsertItemPosition" />
<Parameter Name="keyArray" Type="System.Collections.ArrayList" />
</Parameters>
<Docs>
<param name="dataSource">The data source.</param>
<param name="dataBinding">
<see langword="true" /> to indicate that the <see cref="T:System.Web.UI.WebControls.ListView" /> control is bound to data; otherwise, <see langword="false" />.</param>
<param name="insertPosition">One of the <see cref="T:System.Web.UI.WebControls.InsertItemPosition" /> values.</param>
<param name="keyArray">An array that represents the data-key value of each item in the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</param>
<summary>Creates the <see cref="T:System.Web.UI.WebControls.ListView" /> control hierarchy in groups.</summary>
<returns>An object that contains all the data items of the current page of data in a <see cref="T:System.Web.UI.WebControls.ListView" /> control.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.ListView.CreateItemsInGroups%2A> method is used to create the control hierarchy of the <xref:System.Web.UI.WebControls.ListView> control in groups. This method is used by the <xref:System.Web.UI.WebControls.ListView> control only when the <xref:System.Web.UI.WebControls.ListView.GroupTemplate%2A> and <xref:System.Web.UI.WebControls.ListView.GroupItemCount%2A> properties are defined.
> [!NOTE]
> This method is primarily used by control developers to extend the <xref:System.Web.UI.WebControls.ListView> control.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">The <see cref="T:System.Web.UI.WebControls.ListView" /> control does not have an item placeholder specified.</exception>
<altmember cref="M:System.Web.UI.WebControls.ListView.CreateItemsWithoutGroups(System.Web.UI.WebControls.ListViewPagedDataSource,System.Boolean,System.Web.UI.WebControls.InsertItemPosition,System.Collections.ArrayList)" />
<altmember cref="P:System.Web.UI.WebControls.ListView.GroupItemCount" />
<altmember cref="P:System.Web.UI.WebControls.ListView.GroupTemplate" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="CreateItemsWithoutGroups">
<MemberSignature Language="C#" Value="protected virtual System.Collections.Generic.IList&lt;System.Web.UI.WebControls.ListViewDataItem&gt; CreateItemsWithoutGroups (System.Web.UI.WebControls.ListViewPagedDataSource dataSource, bool dataBinding, System.Web.UI.WebControls.InsertItemPosition insertPosition, System.Collections.ArrayList keyArray);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance class System.Collections.Generic.IList`1&lt;class System.Web.UI.WebControls.ListViewDataItem&gt; CreateItemsWithoutGroups(class System.Web.UI.WebControls.ListViewPagedDataSource dataSource, bool dataBinding, valuetype System.Web.UI.WebControls.InsertItemPosition insertPosition, class System.Collections.ArrayList keyArray) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.ListView.CreateItemsWithoutGroups(System.Web.UI.WebControls.ListViewPagedDataSource,System.Boolean,System.Web.UI.WebControls.InsertItemPosition,System.Collections.ArrayList)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function CreateItemsWithoutGroups (dataSource As ListViewPagedDataSource, dataBinding As Boolean, insertPosition As InsertItemPosition, keyArray As ArrayList) As IList(Of ListViewDataItem)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Collections::Generic::IList&lt;System::Web::UI::WebControls::ListViewDataItem ^&gt; ^ CreateItemsWithoutGroups(System::Web::UI::WebControls::ListViewPagedDataSource ^ dataSource, bool dataBinding, System::Web::UI::WebControls::InsertItemPosition insertPosition, System::Collections::ArrayList ^ keyArray);" />
<MemberSignature Language="F#" Value="abstract member CreateItemsWithoutGroups : System.Web.UI.WebControls.ListViewPagedDataSource * bool * System.Web.UI.WebControls.InsertItemPosition * System.Collections.ArrayList -&gt; System.Collections.Generic.IList&lt;System.Web.UI.WebControls.ListViewDataItem&gt;&#xA;override this.CreateItemsWithoutGroups : System.Web.UI.WebControls.ListViewPagedDataSource * bool * System.Web.UI.WebControls.InsertItemPosition * System.Collections.ArrayList -&gt; System.Collections.Generic.IList&lt;System.Web.UI.WebControls.ListViewDataItem&gt;" Usage="listView.CreateItemsWithoutGroups (dataSource, dataBinding, insertPosition, keyArray)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Collections.Generic.IList&lt;System.Web.UI.WebControls.ListViewDataItem&gt;</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="dataSource" Type="System.Web.UI.WebControls.ListViewPagedDataSource" />
<Parameter Name="dataBinding" Type="System.Boolean" />
<Parameter Name="insertPosition" Type="System.Web.UI.WebControls.InsertItemPosition" />
<Parameter Name="keyArray" Type="System.Collections.ArrayList" />
</Parameters>
<Docs>
<param name="dataSource">The data source.</param>
<param name="dataBinding">
<see langword="true" /> to indicate that the <see cref="T:System.Web.UI.WebControls.ListView" /> control is bound to data; otherwise, <see langword="false" />.</param>
<param name="insertPosition">One of the <see cref="T:System.Web.UI.WebControls.InsertItemPosition" /> values.</param>
<param name="keyArray">An array that represents the data-key value of each item in the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</param>
<summary>Creates the <see cref="T:System.Web.UI.WebControls.ListView" /> control hierarchy without groups.</summary>
<returns>An object that contains all the data items of the current page of data in a <see cref="T:System.Web.UI.WebControls.ListView" /> control.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.ListView.CreateItemsWithoutGroups%2A> method is used to create the control hierarchy of the <xref:System.Web.UI.WebControls.ListView> control. This method is used by the <xref:System.Web.UI.WebControls.ListView> control only when the <xref:System.Web.UI.WebControls.ListView.GroupTemplate%2A> property is not defined.
> [!NOTE]
> This method is primarily used by control developers to extend the <xref:System.Web.UI.WebControls.ListView> control.
]]></format>
</remarks>
<altmember cref="M:System.Web.UI.WebControls.ListView.CreateItemsInGroups(System.Web.UI.WebControls.ListViewPagedDataSource,System.Boolean,System.Web.UI.WebControls.InsertItemPosition,System.Collections.ArrayList)" />
<altmember cref="P:System.Web.UI.WebControls.ListView.GroupTemplate" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="CreateLayoutTemplate">
<MemberSignature Language="C#" Value="protected virtual void CreateLayoutTemplate ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void CreateLayoutTemplate() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.ListView.CreateLayoutTemplate" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub CreateLayoutTemplate ()" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void CreateLayoutTemplate();" />
<MemberSignature Language="F#" Value="abstract member CreateLayoutTemplate : unit -&gt; unit&#xA;override this.CreateLayoutTemplate : unit -&gt; unit" Usage="listView.CreateLayoutTemplate " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates the root container in the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.ListView.CreateLayoutTemplate%2A> method is a helper method that is used to create the root container in the <xref:System.Web.UI.WebControls.ListView> control. The contents of the container are defined by the <xref:System.Web.UI.WebControls.ListView.LayoutTemplate%2A> property.
> [!NOTE]
> This method is primarily used by control developers to extend the <xref:System.Web.UI.WebControls.ListView> control.
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.ListView.LayoutTemplate" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="CreateSuffixArrayList">
<MemberSignature Language="C#" Value="protected virtual void CreateSuffixArrayList (System.Web.UI.WebControls.ListViewPagedDataSource dataSource, System.Collections.ArrayList suffixArray);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void CreateSuffixArrayList(class System.Web.UI.WebControls.ListViewPagedDataSource dataSource, class System.Collections.ArrayList suffixArray) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.ListView.CreateSuffixArrayList(System.Web.UI.WebControls.ListViewPagedDataSource,System.Collections.ArrayList)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub CreateSuffixArrayList (dataSource As ListViewPagedDataSource, suffixArray As ArrayList)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void CreateSuffixArrayList(System::Web::UI::WebControls::ListViewPagedDataSource ^ dataSource, System::Collections::ArrayList ^ suffixArray);" />
<MemberSignature Language="F#" Value="abstract member CreateSuffixArrayList : System.Web.UI.WebControls.ListViewPagedDataSource * System.Collections.ArrayList -&gt; unit&#xA;override this.CreateSuffixArrayList : System.Web.UI.WebControls.ListViewPagedDataSource * System.Collections.ArrayList -&gt; unit" Usage="listView.CreateSuffixArrayList (dataSource, suffixArray)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="dataSource" Type="System.Web.UI.WebControls.ListViewPagedDataSource" Index="0" 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" />
<Parameter Name="suffixArray" Type="System.Collections.ArrayList" Index="1" 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" />
</Parameters>
<Docs>
<param name="dataSource">The data source that will supply values for the suffix.</param>
<param name="suffixArray">The suffix array.</param>
<summary>Creates an array of suffixes for ASP.NET to use when it generates the <see cref="P:System.Web.UI.Control.ClientID" /> value.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="CssClass">
<MemberSignature Language="C#" Value="public override string CssClass { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string CssClass" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.CssClass" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property CssClass As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::String ^ CssClass { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.CssClass : string with get, set" Usage="System.Web.UI.WebControls.ListView.CssClass" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Browsable(false)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Web.UI.CssClassProperty</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Hidden)</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Overrides the <see cref="P:System.Web.UI.WebControls.WebControl.CssClass" /> property. Setting this property is not supported by the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<value>
<see cref="F:System.String.Empty" />, which indicates that this property is not set.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Style properties are not supported by the <xref:System.Web.UI.WebControls.ListView> control. If you try to set the <xref:System.Web.UI.WebControls.ListView.CssClass%2A> property, a <xref:System.NotSupportedException> exception is thrown. If you get the property, it returns the default value of the corresponding property of the base class.
To style the <xref:System.Web.UI.WebControls.ListView> control, you must style the controls inside the <xref:System.Web.UI.WebControls.ListView> templates by using cascading style sheets (CSS) classes or inline style elements.
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">An attempt was made to set the <see cref="P:System.Web.UI.WebControls.ListView.CssClass" /> property.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</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.ListView.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.ListView.DataKeyNames" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Web.UI.WebControls.IDataBoundControl.DataKeyNames</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Category("Data")</AttributeName>
</Attribute>
<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-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 primary key fields for the items displayed in a <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<value>An array that contains the names of the primary key fields for the items displayed in a <see cref="T:System.Web.UI.WebControls.ListView" /> control.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.ListView.DataKeyNames%2A> property to specify the field or fields that represent the primary key of the data source. To set this property declaratively, use a comma-separated list of field names.
When the <xref:System.Web.UI.WebControls.ListView.DataKeyNames%2A> property is set, the <xref:System.Web.UI.WebControls.ListView> control automatically populates its <xref:System.Web.UI.WebControls.ListView.DataKeys%2A> collection with the values from the specified field or fields. This provides a convenient way to access the primary keys of each item.
> [!IMPORTANT]
> The <xref:System.Web.UI.WebControls.ListView> control stores key field values in the control-state field. If these values contain sensitive information, we recommend that you enable view-state encryption by setting the <xref:System.Web.UI.Page.ViewStateEncryptionMode%2A> property to `ViewStateEncryptionMode.Always`.
You must set the <xref:System.Web.UI.WebControls.ListView.DataKeyNames%2A> property for the automatic updating and deleting features of the <xref:System.Web.UI.WebControls.ListView> control to work. The values of these key fields are passed to the data source control in order to match the item to update or delete.
Fields that are specified as data keys by using the <xref:System.Web.UI.WebControls.ListView.DataKeyNames%2A> property are passed to the data source control during update and delete operations by using the `Keys` collection. Data key fields are passed to the data source control even if they are not bound to controls in a template.
## Examples
The following example shows how to use the <xref:System.Web.UI.WebControls.ListView.DataKeyNames%2A> property to specify the key field of the data source.
[!code-aspx-csharp[System.Web.UI.WebControls.ListViewItemCommand#3](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.ListViewItemCommand/CS/ListViewItemCommandCS.aspx#3)]
[!code-aspx-vb[System.Web.UI.WebControls.ListViewItemCommand#3](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.ListViewItemCommand/VB/ListViewItemCommandVB.aspx#3)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.DataKey" />
<altmember cref="T:System.Web.UI.WebControls.DataKeyArray" />
<altmember cref="P:System.Web.UI.WebControls.ListView.DataKeys" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="DataKeys">
<MemberSignature Language="C#" Value="public virtual System.Web.UI.WebControls.DataKeyArray DataKeys { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.WebControls.DataKeyArray DataKeys" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.DataKeys" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property DataKeys As DataKeyArray" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Web::UI::WebControls::DataKeyArray ^ DataKeys { System::Web::UI::WebControls::DataKeyArray ^ get(); };" />
<MemberSignature Language="F#" Value="member this.DataKeys : System.Web.UI.WebControls.DataKeyArray" Usage="System.Web.UI.WebControls.ListView.DataKeys" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Web.UI.WebControls.IDataBoundListControl.DataKeys</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.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.DataKeyArray</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a collection of <see cref="T:System.Web.UI.WebControls.DataKey" /> objects that represent the data-key value for each item in a <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<value>An object that contains the data key for each item in a <see cref="T:System.Web.UI.WebControls.ListView" /> control.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When the <xref:System.Web.UI.WebControls.ListView.DataKeyNames%2A> property is set, the <xref:System.Web.UI.WebControls.ListView> control automatically creates a <xref:System.Web.UI.WebControls.DataKey> object for each item in the control. The <xref:System.Web.UI.WebControls.DataKey> object contains the values of the field or fields that are specified in the <xref:System.Web.UI.WebControls.ListView.DataKeyNames%2A> property. The <xref:System.Web.UI.WebControls.DataKey> objects are then added to the control's <xref:System.Web.UI.WebControls.ListView.DataKeys%2A> collection.
Use the <xref:System.Web.UI.WebControls.ListView.DataKeys%2A> property to retrieve the <xref:System.Web.UI.WebControls.DataKey> object for a specific data item in the <xref:System.Web.UI.WebControls.ListView> control.
You can use the <xref:System.Web.UI.WebControls.ListView.SelectedDataKey%2A> property to retrieve the <xref:System.Web.UI.WebControls.DataKey> object for the currently selected item. You can also use the <xref:System.Web.UI.WebControls.ListView.SelectedValue%2A> property to retrieve the data-key value for the currently selected item directly.
You can use the <xref:System.Web.UI.WebControls.ListViewDataItem.DisplayIndex%2A?displayProperty=nameWithType> property to retrieve the <xref:System.Web.UI.WebControls.DataKey> object for the item for which a command button was clicked.
## Examples
The following example shows how to use the <xref:System.Web.UI.WebControls.ListView.DataKeys%2A> property to determine the data-key values for the items in a <xref:System.Web.UI.WebControls.ListView> control. It also shows how to preserve the user selection based on a data item instead of the default behavior that uses the index.
[!code-csharp[System.Web.UI.WebControls.ListView.SelectedIndexChanged#3](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.SelectedIndexChanged/CS/ListViewItemSelectedIndexChanged2CS.aspx#3)]
[!code-vb[System.Web.UI.WebControls.ListView.SelectedIndexChanged#3](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.SelectedIndexChanged/VB/ListViewItemSelectedIndexChanged2VB.aspx#3)]
]]></format>
</remarks>
<altmember cref="T:System.Web.UI.WebControls.DataKey" />
<altmember cref="T:System.Web.UI.WebControls.DataKeyArray" />
<altmember cref="P:System.Web.UI.WebControls.ListView.DataKeyNames" />
<altmember cref="P:System.Web.UI.WebControls.ListView.SelectedDataKey" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="DeleteItem">
<MemberSignature Language="C#" Value="public virtual void DeleteItem (int itemIndex);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void DeleteItem(int32 itemIndex) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.ListView.DeleteItem(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Sub DeleteItem (itemIndex As Integer)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void DeleteItem(int itemIndex);" />
<MemberSignature Language="F#" Value="abstract member DeleteItem : int -&gt; unit&#xA;override this.DeleteItem : int -&gt; unit" Usage="listView.DeleteItem itemIndex" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="itemIndex" Type="System.Int32" />
</Parameters>
<Docs>
<param name="itemIndex">The index of the item to delete.</param>
<summary>Deletes the record at the specified index from the data source.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.ListView.DeleteItem%2A> method to programmatically delete the record at the specified index from the data source. This method is typically used to delete a record from outside the <xref:System.Web.UI.WebControls.ListView> control, such as from a different control on the page. This method raises the <xref:System.Web.UI.WebControls.ListView.ItemDeleted> and <xref:System.Web.UI.WebControls.ListView.ItemDeleting> events.
## Examples
The following example shows how to use the <xref:System.Web.UI.WebControls.ListView.DeleteItem%2A> method to programmatically delete the selected item in a <xref:System.Web.UI.WebControls.ListView> control from the data source.
[!code-aspx-csharp[System.Web.UI.WebControls.ListView.DeleteItem#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.DeleteItem/CS/ListViewDeleteItemCS.aspx#1)]
[!code-aspx-vb[System.Web.UI.WebControls.ListView.DeleteItem#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.DeleteItem/VB/ListViewDeleteItemVB.aspx#1)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">
<paramref name="itemIndex" /> is less than 0.
-or-
The <see cref="T:System.Web.UI.DataSourceView" /> object that is associated with the <see cref="T:System.Web.UI.WebControls.ListView" /> control is <see langword="null" />.</exception>
<altmember cref="E:System.Web.UI.WebControls.ListView.ItemDeleted" />
<altmember cref="E:System.Web.UI.WebControls.ListView.ItemDeleting" />
<altmember cref="M:System.Web.UI.WebControls.ListView.InsertNewItem(System.Boolean)" />
<altmember cref="M:System.Web.UI.WebControls.ListView.UpdateItem(System.Int32,System.Boolean)" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</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.ListView.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.ListView.DeleteMethod" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</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>
<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.WebCategory("Data")</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.WebSysDescription("DataBoundControl_DeleteMethod")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the name of the method to call in order to delete data.</summary>
<value>The name of the method.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Setting this property causes model binding to be used as the data-binding method.
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="EditIndex">
<MemberSignature Language="C#" Value="public virtual int EditIndex { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 EditIndex" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.EditIndex" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property EditIndex As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property int EditIndex { int get(); void set(int value); };" />
<MemberSignature Language="F#" Value="member this.EditIndex : int with get, set" Usage="System.Web.UI.WebControls.ListView.EditIndex" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Category("Default")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(-1)</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 or sets the index of the item being edited.</summary>
<value>The zero-based index of the item being edited. The default is -1, which indicates that no item is being edited.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use the <xref:System.Web.UI.WebControls.ListView.EditIndex%2A> property to programmatically specify or determine which item in a <xref:System.Web.UI.WebControls.ListView> control to edit. When this property is set to the index of an item in the control, that item is displayed in edit mode. In edit mode, the item is rendered by using the <xref:System.Web.UI.WebControls.ListView.EditItemTemplate%2A> template instead of the <xref:System.Web.UI.WebControls.ListView.ItemTemplate%2A> template. You can populate the <xref:System.Web.UI.WebControls.ListView.EditItemTemplate%2A> with data-bound controls to enable users to modify values for the item. To switch from edit mode to display mode, set this property to -1.
The <xref:System.Web.UI.WebControls.ListView.EditIndex%2A> property is typically used when you have to programmatically determine which item is being edited, or when you are adding custom editing functionality to the <xref:System.Web.UI.WebControls.ListView> control. The <xref:System.Web.UI.WebControls.ListView> control has a built-in editing feature that automatically puts an item in edit mode if you add a button to the item template whose <xref:System.Web.UI.WebControls.Button.CommandName%2A> property is set to `Edit`.
## Examples
The following example shows how to use the <xref:System.Web.UI.WebControls.ListView.EditIndex%2A> property to determine whether an item is in edit mode in the <xref:System.Web.UI.WebControls.ListView> control. This code example is part of a larger example provided for the <xref:System.Web.UI.WebControls.ListViewDataItem> class.
[!code-csharp[System.Web.UI.WebControls.ListViewDataItem#2](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.ListViewDataItem/CS/ListViewDataItemDataItemCS.aspx#2)]
[!code-vb[System.Web.UI.WebControls.ListViewDataItem#2](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.ListViewDataItem/VB/ListViewDataItemDataItemVB.aspx#2)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The <see cref="P:System.Web.UI.WebControls.ListView.EditIndex" /> property is set to a value less than -1.</exception>
<altmember cref="P:System.Web.UI.WebControls.ListView.AlternatingItemTemplate" />
<altmember cref="P:System.Web.UI.WebControls.ListView.DataKeys" />
<altmember cref="P:System.Web.UI.WebControls.ListView.DataKeyNames" />
<altmember cref="P:System.Web.UI.WebControls.ListView.EditItem" />
<altmember cref="P:System.Web.UI.WebControls.ListView.EditItemTemplate" />
<altmember cref="E:System.Web.UI.WebControls.ListView.ItemEditing" />
<altmember cref="P:System.Web.UI.WebControls.ListView.ItemTemplate" />
<altmember cref="E:System.Web.UI.WebControls.ListView.ItemUpdated" />
<altmember cref="E:System.Web.UI.WebControls.ListView.ItemUpdating" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="EditItem">
<MemberSignature Language="C#" Value="public virtual System.Web.UI.WebControls.ListViewItem EditItem { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.WebControls.ListViewItem EditItem" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.EditItem" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property EditItem As ListViewItem" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Web::UI::WebControls::ListViewItem ^ EditItem { System::Web::UI::WebControls::ListViewItem ^ get(); };" />
<MemberSignature Language="F#" Value="member this.EditItem : System.Web.UI.WebControls.ListViewItem" Usage="System.Web.UI.WebControls.ListView.EditItem" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.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.ListViewItem</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the item that is in edit mode in a <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<value>The item that is in edit mode in a <see cref="T:System.Web.UI.WebControls.ListView" /> control, or <see langword="null" /> if no item is in edit mode.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.ListView.EditItem%2A> property to access the item that is in edit mode in a <xref:System.Web.UI.WebControls.ListView> control. The content of an edit item is defined by the <xref:System.Web.UI.WebControls.ListView.EditItemTemplate%2A> property.
## Examples
The following example shows how to retrieve the item that is in edit mode by using the <xref:System.Web.UI.WebControls.ListView.EditItem%2A> property to access controls that are contained in the <xref:System.Web.UI.WebControls.ListView.EditItemTemplate%2A> template.
> [!IMPORTANT]
> This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see [Script Exploits Overview](https://msdn.microsoft.com/library/772c7312-211a-4eb3-8d6e-eec0aa1dcc07).
[!code-aspx-csharp[System.Web.UI.WebControls.ListView.ItemEditing#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.ItemEditing/CS/ListViewItemEditingCS.aspx#1)]
[!code-aspx-vb[System.Web.UI.WebControls.ListView.ItemEditing#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.ItemEditing/VB/ListViewItemEditingVB.aspx#1)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.ListView.EditItemTemplate" />
<altmember cref="P:System.Web.UI.WebControls.ListView.EditIndex" />
<altmember cref="T:System.Web.UI.WebControls.ListViewItem" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="EditItemTemplate">
<MemberSignature Language="C#" Value="public virtual System.Web.UI.ITemplate EditItemTemplate { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.ITemplate EditItemTemplate" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.EditItemTemplate" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property EditItemTemplate As ITemplate" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Web::UI::ITemplate ^ EditItemTemplate { System::Web::UI::ITemplate ^ get(); void set(System::Web::UI::ITemplate ^ value); };" />
<MemberSignature Language="F#" Value="member this.EditItemTemplate : System.Web.UI.ITemplate with get, set" Usage="System.Web.UI.WebControls.ListView.EditItemTemplate" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.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.ListViewDataItem), System.ComponentModel.BindingDirection.TwoWay)</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 custom content for the item in edit mode.</summary>
<value>An object that contains the custom content for the item in edit mode. The default is <see langword="null" />, which indicates that this property is not set.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.ListView.EditItemTemplate%2A> property to define a custom user interface (UI) for the item in edit mode. The <xref:System.Web.UI.WebControls.ListView.EditItemTemplate%2A> template usually contains the input controls for the user to update the values of an existing record. It also usually contains buttons to update the record and to cancel the update operation.
To specify the custom template declaratively, add an `EditItemTemplate` element inside the <xref:System.Web.UI.WebControls.ListView> control. Then add the contents and controls for template to the `EditItemTemplate` element. You can associate a field with an input control by using a two-way binding expression. This enables the <xref:System.Web.UI.WebControls.ListView> control to automatically display the original field value in the associated input control for the item in edit mode. When a record is updated, the <xref:System.Web.UI.WebControls.ListView> control can automatically extract the updated field value from the associated input control. For more information, see [Data-Binding Expressions Overview](https://msdn.microsoft.com/library/14cdd57d-0f82-4667-b503-73e1a96f136a).
To create buttons that perform the built-in cancel and update operations, add a button control to the template. Set its <xref:System.Web.UI.WebControls.Button.CommandName%2A> property to one of the values listed in the following table.
|Button type|CommandName value|
|-----------------|-----------------------|
|Cancel|"Cancel"|
|Update|"Update"|
## Examples
The following example shows how to define a custom template for the item in edit mode.
> [!IMPORTANT]
> This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see [Script Exploits Overview](https://msdn.microsoft.com/library/772c7312-211a-4eb3-8d6e-eec0aa1dcc07).
[!code-aspx-csharp[System.Web.UI.WebControls.ListView.EditItemTemplate#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.EditItemTemplate/CS/ListViewEditItemTemplateCS.aspx#1)]
[!code-aspx-vb[System.Web.UI.WebControls.ListView.EditItemTemplate#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.EditItemTemplate/VB/ListViewEditItemTemplateVB.aspx#1)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.ListView.EditIndex" />
<altmember cref="P:System.Web.UI.WebControls.ListView.EditItem" />
<altmember cref="E:System.Web.UI.WebControls.ListView.ItemEditing" />
<altmember cref="P:System.Web.UI.WebControls.ListView.ItemTemplate" />
<altmember cref="P:System.Web.UI.WebControls.ListView.LayoutTemplate" />
<altmember cref="E:System.Web.UI.WebControls.ListView.ItemUpdated" />
<altmember cref="E:System.Web.UI.WebControls.ListView.ItemUpdating" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
<related type="Article" href="https://msdn.microsoft.com/library/14cdd57d-0f82-4667-b503-73e1a96f136a">Data-Binding Expression Syntax</related>
</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.ListView.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.ListView.EmptyDataTemplate" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.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.TemplateContainer(typeof(System.Web.UI.WebControls.ListView))</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)</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 template that is rendered when a <see cref="T:System.Web.UI.WebControls.ListView" /> control is bound to a data source that does not contain any records.</summary>
<value>An object that contains the custom content for the empty template. The default is <see langword="null" />, which indicates that this property is not set.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The empty template is displayed in a <xref:System.Web.UI.WebControls.ListView> control when the data source that is bound to the control does not contain any records and the <xref:System.Web.UI.WebControls.ListView.InsertItemPosition%2A> property is set to <xref:System.Web.UI.WebControls.InsertItemPosition.None?displayProperty=nameWithType>. The template is rendered instead of the <xref:System.Web.UI.WebControls.ListView.LayoutTemplate%2A> template. If the <xref:System.Web.UI.WebControls.ListView.InsertItemPosition%2A> property is set to a value other than <xref:System.Web.UI.WebControls.InsertItemPosition.None?displayProperty=nameWithType>, the <xref:System.Web.UI.WebControls.ListView.EmptyDataTemplate%2A> template is not rendered.
You can define a custom user interface (UI) for the empty template by using the <xref:System.Web.UI.WebControls.ListView.EmptyDataTemplate%2A> property. To specify a custom template declaratively for the empty template, add and `EmptyDataTemplate` element inside the <xref:System.Web.UI.WebControls.ListView> control. You can then add the contents of the template to the `EmptyDataTemplate` element.
## Examples
The following example shows how to define a custom template for the empty template.
[!code-aspx-csharp[System.Web.UI.WebControls.ListView.EmptyDataTemplate#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.EmptyDataTemplate/CS/ListViewEmptyDataTemplateCS.aspx#1)]
[!code-aspx-vb[System.Web.UI.WebControls.ListView.EmptyDataTemplate#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.EmptyDataTemplate/VB/ListViewEmptyDataTemplateVB.aspx#1)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.ListView.EmptyItemTemplate" />
<altmember cref="P:System.Web.UI.WebControls.ListView.LayoutTemplate" />
<altmember cref="P:System.Web.UI.WebControls.ListView.InsertItemPosition" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="EmptyItemTemplate">
<MemberSignature Language="C#" Value="public virtual System.Web.UI.ITemplate EmptyItemTemplate { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.ITemplate EmptyItemTemplate" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.EmptyItemTemplate" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property EmptyItemTemplate As ITemplate" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Web::UI::ITemplate ^ EmptyItemTemplate { System::Web::UI::ITemplate ^ get(); void set(System::Web::UI::ITemplate ^ value); };" />
<MemberSignature Language="F#" Value="member this.EmptyItemTemplate : System.Web.UI.ITemplate with get, set" Usage="System.Web.UI.WebControls.ListView.EmptyItemTemplate" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.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.TemplateContainer(typeof(System.Web.UI.WebControls.ListViewItem))</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)</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 item that is rendered in a <see cref="T:System.Web.UI.WebControls.ListView" /> control when there are no more data items to display in the last row of the current data page.</summary>
<value>An object that contains the custom content for the empty item. The default is <see langword="null" />, which indicates that this property is not set.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The empty item is displayed in a <xref:System.Web.UI.WebControls.ListView> control when there are no more data items to display in the last group of the current page. This can occur only if <xref:System.Web.UI.WebControls.ListView.GroupItemCount%2A> is set to a value greater than 1. For example, in a <xref:System.Web.UI.WebControls.ListView> control, the <xref:System.Web.UI.WebControls.ListView.GroupItemCount%2A> property might be set to 5 and the total number of items returned from the data source is 8. In that case, the last row of data will contain three items defined by the <xref:System.Web.UI.WebControls.ListView.ItemTemplate%2A> template and two items defined by the <xref:System.Web.UI.WebControls.ListView.EmptyItemTemplate%2A> template.
You can define a custom user interface (UI) for the empty item by using the <xref:System.Web.UI.WebControls.ListView.EmptyItemTemplate%2A> property. To specify a custom template declaratively for the empty item, add an `EmptyItemTemplate` element inside the <xref:System.Web.UI.WebControls.ListView> control. You can then add the contents of the template to the `EmptyItemTemplate` element.
## Examples
The following example shows how to define a custom template for the empty item.
[!code-aspx-csharp[System.Web.UI.WebControls.ListView.EmptyItemTemplate#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.EmptyItemTemplate/CS/ListViewEmptyItemTemplateCS.aspx#1)]
[!code-aspx-vb[System.Web.UI.WebControls.ListView.EmptyItemTemplate#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.EmptyItemTemplate/VB/ListViewEmptyItemTemplateVB.aspx#1)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.ListView.EmptyDataTemplate" />
<altmember cref="P:System.Web.UI.WebControls.ListView.GroupItemCount" />
<altmember cref="P:System.Web.UI.WebControls.ListView.ItemTemplate" />
<altmember cref="P:System.Web.UI.WebControls.ListView.LayoutTemplate" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</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.ListView.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.ListView.EnableModelValidation" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.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>
<AttributeName>System.Web.WebCategory("Behavior")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="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 a validator control will handle exceptions that occur during insert or update operations.</summary>
<value>
<see langword="true" /> if a validator control will handle exceptions that occur during insert or update operations; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="EnablePersistedSelection">
<MemberSignature Language="C#" Value="public virtual bool EnablePersistedSelection { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool EnablePersistedSelection" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.EnablePersistedSelection" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property EnablePersistedSelection As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property bool EnablePersistedSelection { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.EnablePersistedSelection : bool with get, set" Usage="System.Web.UI.WebControls.ListView.EnablePersistedSelection" />
<MemberType>Property</MemberType>
<Implements>
<InterfaceMember>P:System.Web.UI.WebControls.IDataBoundListControl.EnablePersistedSelection</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<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(false)</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.WebCategory("Behavior")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value that indicates whether row selection persists when a user pages through data in a data-bound control.</summary>
<value>
<see langword="true" /> if row selection persists; otherwise, <see langword="false" />. The default is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can specify how selected rows are persisted when the <xref:System.Web.UI.WebControls.ListView> control is in paging mode. By default, row selection is based on row index. The same row (for example, the third row) is selected on each page. Alternatively, you can enable persistence based on the data key of the selected row. In that case, if you select row 3 on page 1 and you move to page 2, no row is selected on page 2. If you move back to page 1, row 3 is still selected. To enable this functionality, set this property to `true`.
> [!NOTE]
> In versions 2.0, 3.0, and 3.5 of ASP.NET, row selection was based only on row index. By default, row selection in ASP.NET 4 is based on index for backward compatibility.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="EnsureLayoutTemplate">
<MemberSignature Language="C#" Value="protected virtual void EnsureLayoutTemplate ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void EnsureLayoutTemplate() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.ListView.EnsureLayoutTemplate" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Sub EnsureLayoutTemplate ()" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void EnsureLayoutTemplate();" />
<MemberSignature Language="F#" Value="abstract member EnsureLayoutTemplate : unit -&gt; unit&#xA;override this.EnsureLayoutTemplate : unit -&gt; unit" Usage="listView.EnsureLayoutTemplate " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Ensures that the <see cref="P:System.Web.UI.WebControls.ListView.LayoutTemplate" /> content is correctly created in the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.UI.WebControls.ListView.EnsureLayoutTemplate%2A> method is a helper method that is called by the <xref:System.Web.UI.WebControls.ListView> control to make sure that the <xref:System.Web.UI.WebControls.ListView.LayoutTemplate%2A> content is added to the control only one time.
]]></format>
</remarks>
<altmember cref="M:System.Web.UI.WebControls.ListView.CreateLayoutTemplate" />
<altmember cref="P:System.Web.UI.WebControls.ListView.LayoutTemplate" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="ExtractItemValues">
<MemberSignature Language="C#" Value="public virtual void ExtractItemValues (System.Collections.Specialized.IOrderedDictionary itemValues, System.Web.UI.WebControls.ListViewItem item, bool includePrimaryKey);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void ExtractItemValues(class System.Collections.Specialized.IOrderedDictionary itemValues, class System.Web.UI.WebControls.ListViewItem item, bool includePrimaryKey) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.ListView.ExtractItemValues(System.Collections.Specialized.IOrderedDictionary,System.Web.UI.WebControls.ListViewItem,System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Sub ExtractItemValues (itemValues As IOrderedDictionary, item As ListViewItem, includePrimaryKey As Boolean)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void ExtractItemValues(System::Collections::Specialized::IOrderedDictionary ^ itemValues, System::Web::UI::WebControls::ListViewItem ^ item, bool includePrimaryKey);" />
<MemberSignature Language="F#" Value="abstract member ExtractItemValues : System.Collections.Specialized.IOrderedDictionary * System.Web.UI.WebControls.ListViewItem * bool -&gt; unit&#xA;override this.ExtractItemValues : System.Collections.Specialized.IOrderedDictionary * System.Web.UI.WebControls.ListViewItem * bool -&gt; unit" Usage="listView.ExtractItemValues (itemValues, item, includePrimaryKey)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="itemValues" Type="System.Collections.Specialized.IOrderedDictionary" />
<Parameter Name="item" Type="System.Web.UI.WebControls.ListViewItem" />
<Parameter Name="includePrimaryKey" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="itemValues">A dictionary object that is used to store the field values.</param>
<param name="item">The <see cref="T:System.Web.UI.WebControls.ListViewItem" /> object from which to retrieve the field values.</param>
<param name="includePrimaryKey">
<see langword="true" /> to include the primary key field or fields; otherwise, <see langword="false" />.</param>
<summary>Retrieves the values of each field that is declared in the specified item, 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.ListView.ExtractItemValues%2A> method is a helper method that is called by the <xref:System.Web.UI.WebControls.ListView> control to retrieve the values of each field that is declared in `item`. You can specify whether the extracted values include key fields by using the `includePrimaryKey` parameter.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="itemValues" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">
<paramref name="item" /> is not a <see cref="T:System.Web.UI.WebControls.ListViewDataItem" /> object.</exception>
<altmember cref="T:System.Collections.Specialized.IOrderedDictionary" />
<altmember cref="T:System.Web.UI.WebControls.ListViewDataItem" />
<altmember cref="T:System.Web.UI.WebControls.ListViewItem" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="FindPlaceholder">
<MemberSignature Language="C#" Value="protected virtual System.Web.UI.Control FindPlaceholder (string containerID, System.Web.UI.Control container);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance class System.Web.UI.Control FindPlaceholder(string containerID, class System.Web.UI.Control container) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.UI.WebControls.ListView.FindPlaceholder(System.String,System.Web.UI.Control)" />
<MemberSignature Language="VB.NET" Value="Protected Overridable Function FindPlaceholder (containerID As String, container As Control) As Control" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual System::Web::UI::Control ^ FindPlaceholder(System::String ^ containerID, System::Web::UI::Control ^ container);" />
<MemberSignature Language="F#" Value="abstract member FindPlaceholder : string * System.Web.UI.Control -&gt; System.Web.UI.Control&#xA;override this.FindPlaceholder : string * System.Web.UI.Control -&gt; System.Web.UI.Control" Usage="listView.FindPlaceholder (containerID, container)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Web.UI.Control</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="containerID" Type="System.String" />
<Parameter Name="container" Type="System.Web.UI.Control" />
</Parameters>
<Docs>
<param name="containerID">The identifier for the control to be found.</param>
<param name="container">The container to be searched.</param>
<summary>Searches the specified container for a control that has the specified identifier.</summary>
<returns>The specified control, or <see langword="null" /> if the specified control cannot be found.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This method is primarily used by control developers to extend the <xref:System.Web.UI.WebControls.ListView> control.
]]></format>
</remarks>
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="Font">
<MemberSignature Language="C#" Value="public override System.Web.UI.WebControls.FontInfo Font { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.WebControls.FontInfo Font" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.Font" />
<MemberSignature Language="VB.NET" Value="Public Overrides ReadOnly Property Font As FontInfo" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Web::UI::WebControls::FontInfo ^ Font { System::Web::UI::WebControls::FontInfo ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Font : System.Web.UI.WebControls.FontInfo" Usage="System.Web.UI.WebControls.ListView.Font" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.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>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.FontInfo</ReturnType>
</ReturnValue>
<Docs>
<summary>Overrides the <see cref="P:System.Web.UI.WebControls.WebControl.Font" /> property. This property is not supported by the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<value>This property is not supported, and throws a <see cref="T:System.NotSupportedException" /> error.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Style properties are not supported by the <xref:System.Web.UI.WebControls.ListView> control. If you try to access the <xref:System.Web.UI.WebControls.ListView.Font%2A> property, a <xref:System.NotSupportedException> exception is thrown.
To style the <xref:System.Web.UI.WebControls.ListView> control, you must style the controls inside the <xref:System.Web.UI.WebControls.ListView> templates by using cascading style sheets (CSS) classes or inline style elements.
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">An attempt was made to access the <see cref="P:System.Web.UI.WebControls.ListView.Font" /> property.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="ForeColor">
<MemberSignature Language="C#" Value="public override System.Drawing.Color ForeColor { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Drawing.Color ForeColor" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.ForeColor" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property ForeColor As Color" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Drawing::Color ForeColor { System::Drawing::Color get(); void set(System::Drawing::Color value); };" />
<MemberSignature Language="F#" Value="member this.ForeColor : System.Drawing.Color with get, set" Usage="System.Web.UI.WebControls.ListView.ForeColor" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.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>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Drawing.Color</ReturnType>
</ReturnValue>
<Docs>
<summary>Overrides the <see cref="P:System.Web.UI.WebControls.WebControl.ForeColor" /> property. Setting this property is not supported by the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<value>
<see cref="F:System.Drawing.Color.Empty" />, which indicates that the property is not set.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Style properties are not supported by the <xref:System.Web.UI.WebControls.ListView> control. If you try to set the <xref:System.Web.UI.WebControls.ListView.ForeColor%2A> property, a <xref:System.NotSupportedException> exception is thrown. If you get the property, it returns the default value of the corresponding property of the base class.
To style the <xref:System.Web.UI.WebControls.ListView> control, you must style the controls inside the <xref:System.Web.UI.WebControls.ListView> templates by using cascading style sheets (CSS) classes or inline style elements.
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">An attempt was made to set the <see cref="P:System.Web.UI.WebControls.ListView.ForeColor" /> property.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="GroupItemCount">
<MemberSignature Language="C#" Value="public virtual int GroupItemCount { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 GroupItemCount" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.GroupItemCount" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property GroupItemCount As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property int GroupItemCount { int get(); void set(int value); };" />
<MemberSignature Language="F#" Value="member this.GroupItemCount : int with get, set" Usage="System.Web.UI.WebControls.ListView.GroupItemCount" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Category("Default")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(1)</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 or sets the number of items to display per group in a <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<value>The number of items to display per group in a <see cref="T:System.Web.UI.WebControls.ListView" /> control. The default is 1, which indicates that the <see cref="T:System.Web.UI.WebControls.ListView" /> control will display one item per group.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.ListView.GroupItemCount%2A> property to specify the number of items to be grouped together in the <xref:System.Web.UI.WebControls.ListView> control. (In other words, this specifies the number of items to display for each group of the control.) For each group, the <xref:System.Web.UI.WebControls.ListView> control renders the contents of the <xref:System.Web.UI.WebControls.ListView.GroupTemplate%2A> template and replaces the item placeholder with the actual item content. It does this as many times as the number of items defined by the <xref:System.Web.UI.WebControls.ListView.GroupItemCount%2A> property.
You can use <xref:System.Web.UI.WebControls.ListView.GroupItemCount%2A> with the <xref:System.Web.UI.WebControls.ListView.GroupTemplate%2A> template to create a tiled layout in the <xref:System.Web.UI.WebControls.ListView> control. In a tiled table layout, the items are repeated horizontally in a row. The numbers of times that an item is repeated is specified by the <xref:System.Web.UI.WebControls.ListView.GroupItemCount%2A> property.
## Examples
The following example shows how to create a tiled layout in the <xref:System.Web.UI.WebControls.ListView> control by using the <xref:System.Web.UI.WebControls.ListView.GroupItemCount%2A> property. It also shows how to change this property programmatically.
[!code-aspx-csharp[System.Web.UI.WebControls.ListView.GroupItemCount#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.GroupItemCount/CS/ListViewGroupItemCountCS.aspx#1)]
[!code-aspx-vb[System.Web.UI.WebControls.ListView.GroupItemCount#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.GroupItemCount/VB/ListViewGroupItemCountVB.aspx#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The <see cref="P:System.Web.UI.WebControls.ListView.GroupItemCount" /> property is set to a value less than 1.</exception>
<altmember cref="P:System.Web.UI.WebControls.ListView.GroupTemplate" />
<altmember cref="P:System.Web.UI.WebControls.ListView.GroupSeparatorTemplate" />
<altmember cref="P:System.Web.UI.WebControls.ListView.ItemSeparatorTemplate" />
<altmember cref="P:System.Web.UI.WebControls.ListView.ItemTemplate" />
<altmember cref="P:System.Web.UI.WebControls.ListView.LayoutTemplate" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="GroupPlaceholderID">
<MemberSignature Language="C#" Value="public virtual string GroupPlaceholderID { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string GroupPlaceholderID" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.GroupPlaceholderID" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property GroupPlaceholderID As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::String ^ GroupPlaceholderID { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.GroupPlaceholderID : string with get, set" Usage="System.Web.UI.WebControls.ListView.GroupPlaceholderID" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Category("Behavior")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue("groupPlaceholder")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the ID for the group placeholder in a <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<value>The ID for the group placeholder in a <see cref="T:System.Web.UI.WebControls.ListView" /> control. The default is "groupPlaceholder".</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.ListView.GroupPlaceholderID%2A> property to specify an ID for the group placeholder. The group placeholder is the control that you add to the <xref:System.Web.UI.WebControls.ListView.LayoutTemplate%2A> template when you are using groups to represent where the group will be rendered.
## Examples
The following example shows how to use the <xref:System.Web.UI.WebControls.ListView.GroupPlaceholderID%2A> property to specify a different ID for the group placeholder of the <xref:System.Web.UI.WebControls.ListView> control.
[!code-aspx-csharp[System.Web.UI.WebControls.ListView.ItemContainerID#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.ItemContainerID/CS/ListViewItemContainerIDCS.aspx#1)]
[!code-aspx-vb[System.Web.UI.WebControls.ListView.ItemContainerID#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.ItemContainerID/VB/ListViewItemContainerIDVB.aspx#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The specified ID is <see langword="null" /> or an empty string.</exception>
<altmember cref="P:System.Web.UI.WebControls.ListView.GroupItemCount" />
<altmember cref="P:System.Web.UI.WebControls.ListView.GroupTemplate" />
<altmember cref="P:System.Web.UI.WebControls.ListView.ItemPlaceholderID" />
<altmember cref="P:System.Web.UI.WebControls.ListView.LayoutTemplate" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="GroupSeparatorTemplate">
<MemberSignature Language="C#" Value="public virtual System.Web.UI.ITemplate GroupSeparatorTemplate { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.ITemplate GroupSeparatorTemplate" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.GroupSeparatorTemplate" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property GroupSeparatorTemplate As ITemplate" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Web::UI::ITemplate ^ GroupSeparatorTemplate { System::Web::UI::ITemplate ^ get(); void set(System::Web::UI::ITemplate ^ value); };" />
<MemberSignature Language="F#" Value="member this.GroupSeparatorTemplate : System.Web.UI.ITemplate with get, set" Usage="System.Web.UI.WebControls.ListView.GroupSeparatorTemplate" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.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.TemplateContainer(typeof(System.Web.UI.WebControls.ListViewItem))</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)</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 separator between groups in a <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<value>An object that contains the custom content for the group separator. The default is <see langword="null" />, which indicates that this property is not set.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The separator enables you to put an element that has custom content between each group. The <xref:System.Web.UI.WebControls.ListView> control then alternately renders the <xref:System.Web.UI.WebControls.ListView.GroupTemplate%2A> content and the <xref:System.Web.UI.WebControls.ListView.GroupSeparatorTemplate%2A> content. The <xref:System.Web.UI.WebControls.ListView.GroupTemplate%2A> content is always rendered last.
Make sure that you define the content for the whole row in the <xref:System.Web.UI.WebControls.ListView.GroupSeparatorTemplate%2A> template, because the <xref:System.Web.UI.WebControls.ListView> control renders the <xref:System.Web.UI.WebControls.ListView.GroupSeparatorTemplate%2A> content inside the <xref:System.Web.UI.WebControls.ListView.LayoutTemplate%2A> template. For example, the groups in the <xref:System.Web.UI.WebControls.ListView> control might be created by using a table row (`tr`) element. If the <xref:System.Web.UI.WebControls.ListView.GroupItemCount%2A> property is set to 3, the `colspan` attribute must be set to 3 in the <xref:System.Web.UI.WebControls.ListView.GroupSeparatorTemplate%2A> template.
To specify a template declaratively for the separator, add a `GroupSeparatorTemplate` element inside the <xref:System.Web.UI.WebControls.ListView> control. You can then add the contents of the template to the `GroupSeparatorTemplate` element.
## Examples
The following example shows how to create a group separator in the <xref:System.Web.UI.WebControls.ListView> control by using the <xref:System.Web.UI.WebControls.ListView.GroupSeparatorTemplate%2A> property.
[!code-aspx-csharp[System.Web.UI.WebControls.ListView.GroupTemplate#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.GroupTemplate/CS/ListViewGroupTemplateCS.aspx#1)]
[!code-aspx-vb[System.Web.UI.WebControls.ListView.GroupTemplate#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.GroupTemplate/VB/ListViewGroupTemplateVB.aspx#1)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.ListView.GroupItemCount" />
<altmember cref="P:System.Web.UI.WebControls.ListView.GroupTemplate" />
<altmember cref="P:System.Web.UI.WebControls.ListView.ItemSeparatorTemplate" />
<altmember cref="P:System.Web.UI.WebControls.ListView.ItemTemplate" />
<altmember cref="P:System.Web.UI.WebControls.ListView.LayoutTemplate" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="GroupTemplate">
<MemberSignature Language="C#" Value="public virtual System.Web.UI.ITemplate GroupTemplate { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.ITemplate GroupTemplate" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.GroupTemplate" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property GroupTemplate As ITemplate" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Web::UI::ITemplate ^ GroupTemplate { System::Web::UI::ITemplate ^ get(); void set(System::Web::UI::ITemplate ^ value); };" />
<MemberSignature Language="F#" Value="member this.GroupTemplate : System.Web.UI.ITemplate with get, set" Usage="System.Web.UI.WebControls.ListView.GroupTemplate" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.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.TemplateContainer(typeof(System.Web.UI.WebControls.ListViewItem))</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)</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 group container in a <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<value>An object that contains the custom content for the group container in a <see cref="T:System.Web.UI.WebControls.ListView" /> control. The default is <see langword="null" />, which indicates that this property is not set.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.ListView.GroupTemplate%2A> property to create a tiled layout in the <xref:System.Web.UI.WebControls.ListView> control. In a tiled table layout, the items are repeated horizontally in a row. The numbers of times that an item is repeated is specified by the <xref:System.Web.UI.WebControls.ListView.GroupItemCount%2A> property.
To specify a template declaratively for the group container, add a `GroupTemplate` element inside the <xref:System.Web.UI.WebControls.ListView> control. You can then add the contents of the template to the `GroupTemplate` element.
The <xref:System.Web.UI.WebControls.ListView.GroupTemplate%2A> property must include a placeholder for the data item, such as a table cell (`td`), `div`, or `span` element. This placeholder must have the `runat` attribute set to "server" and the `ID` attribute set to the value of the <xref:System.Web.UI.WebControls.ListView.ItemPlaceholderID%2A> property. At run time, the <xref:System.Web.UI.WebControls.ListView> control replaces the placeholder with the content that is defined for each item in the <xref:System.Web.UI.WebControls.ListView.ItemTemplate%2A> and <xref:System.Web.UI.WebControls.ListView.AlternatingItemTemplate%2A> templates.
## Examples
The following example shows how to create a tiled layout in the <xref:System.Web.UI.WebControls.ListView> control by using the <xref:System.Web.UI.WebControls.ListView.GroupTemplate%2A> property.
[!code-aspx-csharp[System.Web.UI.WebControls.ListView.GroupTemplate#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.GroupTemplate/CS/ListViewGroupTemplateCS.aspx#1)]
[!code-aspx-vb[System.Web.UI.WebControls.ListView.GroupTemplate#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.GroupTemplate/VB/ListViewGroupTemplateVB.aspx#1)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.ListView.GroupItemCount" />
<altmember cref="P:System.Web.UI.WebControls.ListView.GroupSeparatorTemplate" />
<altmember cref="P:System.Web.UI.WebControls.ListView.ItemSeparatorTemplate" />
<altmember cref="P:System.Web.UI.WebControls.ListView.ItemTemplate" />
<altmember cref="P:System.Web.UI.WebControls.ListView.LayoutTemplate" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="Height">
<MemberSignature Language="C#" Value="public override System.Web.UI.WebControls.Unit Height { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Web.UI.WebControls.Unit Height" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.Height" />
<MemberSignature Language="VB.NET" Value="Public Overrides Property Height As Unit" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Web::UI::WebControls::Unit Height { System::Web::UI::WebControls::Unit get(); void set(System::Web::UI::WebControls::Unit value); };" />
<MemberSignature Language="F#" Value="member this.Height : System.Web.UI.WebControls.Unit with get, set" Usage="System.Web.UI.WebControls.ListView.Height" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.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>
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.Unit</ReturnType>
</ReturnValue>
<Docs>
<summary>Overrides the <see cref="P:System.Web.UI.WebControls.WebControl.Height" /> property. Setting this property is not supported by the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<value>
<see cref="F:System.Web.UI.WebControls.Unit.Empty" />, which indicates that the property is not set.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Style properties are not supported by the <xref:System.Web.UI.WebControls.ListView> control. If you try to set the <xref:System.Web.UI.WebControls.ListView.Height%2A> property, a <xref:System.NotSupportedException> exception is thrown. If you get the property, it returns the default value of the corresponding property of the base class.
To style the <xref:System.Web.UI.WebControls.ListView> control, you must style the controls inside the <xref:System.Web.UI.WebControls.ListView> templates by using cascading style sheets (CSS) classes or inline style elements.
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">An attempt was made to set the <see cref="P:System.Web.UI.WebControls.ListView.Height" /> property.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="InsertItem">
<MemberSignature Language="C#" Value="public virtual System.Web.UI.WebControls.ListViewItem InsertItem { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.WebControls.ListViewItem InsertItem" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.InsertItem" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property InsertItem As ListViewItem" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Web::UI::WebControls::ListViewItem ^ InsertItem { System::Web::UI::WebControls::ListViewItem ^ get(); };" />
<MemberSignature Language="F#" Value="member this.InsertItem : System.Web.UI.WebControls.ListViewItem" Usage="System.Web.UI.WebControls.ListView.InsertItem" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.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.ListViewItem</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the insert item of a <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<value>An object that represents the insert item of a <see cref="T:System.Web.UI.WebControls.ListView" /> control.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.ListView.InsertItem%2A> property to access the insert item of a <xref:System.Web.UI.WebControls.ListView> control. An insert item is a <xref:System.Web.UI.WebControls.ListViewItem> object whose <xref:System.Web.UI.WebControls.ListViewItem.ItemType%2A> is equal to <xref:System.Web.UI.WebControls.ListViewItemType.InsertItem?displayProperty=nameWithType>. The content of an insert item is defined by the <xref:System.Web.UI.WebControls.ListView.InsertItemTemplate%2A> property.
## Examples
The following example shows how to get the insert item by using the <xref:System.Web.UI.WebControls.ListView.InsertItem%2A> property to access controls that are contained in the <xref:System.Web.UI.WebControls.ListView.InsertItemTemplate%2A> template.
> [!IMPORTANT]
> This example contains text boxes that accept user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see [Script Exploits Overview](https://msdn.microsoft.com/library/772c7312-211a-4eb3-8d6e-eec0aa1dcc07).
[!code-aspx-csharp[System.Web.UI.WebControls.ListView.InsertItem#1](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.InsertItem/CS/ListViewInsertItemCS.aspx#1)]
[!code-aspx-vb[System.Web.UI.WebControls.ListView.InsertItem#1](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.InsertItem/VB/ListViewInsertItemVB.aspx#1)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.ListView.InsertItemPosition" />
<altmember cref="P:System.Web.UI.WebControls.ListView.InsertItemTemplate" />
<altmember cref="T:System.Web.UI.WebControls.ListViewItem" />
<altmember cref="P:System.Web.UI.WebControls.ListViewItem.ItemType" />
<altmember cref="T:System.Web.UI.WebControls.ListViewItemType" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="InsertItemPosition">
<MemberSignature Language="C#" Value="public virtual System.Web.UI.WebControls.InsertItemPosition InsertItemPosition { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Web.UI.WebControls.InsertItemPosition InsertItemPosition" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.InsertItemPosition" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property InsertItemPosition As InsertItemPosition" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Web::UI::WebControls::InsertItemPosition InsertItemPosition { System::Web::UI::WebControls::InsertItemPosition get(); void set(System::Web::UI::WebControls::InsertItemPosition value); };" />
<MemberSignature Language="F#" Value="member this.InsertItemPosition : System.Web.UI.WebControls.InsertItemPosition with get, set" Usage="System.Web.UI.WebControls.ListView.InsertItemPosition" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute>
<AttributeName>System.ComponentModel.Category("Default")</AttributeName>
</Attribute>
<Attribute>
<AttributeName>System.ComponentModel.DefaultValue(Mono.Cecil.CustomAttributeArgument)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Web.UI.WebControls.InsertItemPosition</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the location of the <see cref="P:System.Web.UI.WebControls.ListView.InsertItemTemplate" /> template when it is rendered as part of the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<value>One of the <see cref="T:System.Web.UI.WebControls.InsertItemPosition" /> values. The default is <see cref="F:System.Web.UI.WebControls.InsertItemPosition.None" />, which indicates that the <see cref="P:System.Web.UI.WebControls.ListView.InsertItemTemplate" /> content will not be rendered by the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The following table lists the available item position values.
|Row type|Description|
|--------------|-----------------|
|<xref:System.Web.UI.WebControls.InsertItemPosition.FirstItem?displayProperty=nameWithType>|Renders the <xref:System.Web.UI.WebControls.ListView.InsertItemTemplate%2A> template as the first item in the <xref:System.Web.UI.WebControls.ListView> control.|
|<xref:System.Web.UI.WebControls.InsertItemPosition.LastItem?displayProperty=nameWithType>|Renders the <xref:System.Web.UI.WebControls.ListView.InsertItemTemplate%2A> template as the last item in the <xref:System.Web.UI.WebControls.ListView> control.|
|<xref:System.Web.UI.WebControls.InsertItemPosition.None?displayProperty=nameWithType>|Does not render the <xref:System.Web.UI.WebControls.ListView.InsertItemTemplate%2A> template.|
## Examples
The following example shows how to configure a <xref:System.Web.UI.WebControls.ListView> control to display the <xref:System.Web.UI.WebControls.ListView.InsertItemTemplate%2A> template. This code example is part of a larger example provided for the <xref:System.Web.UI.WebControls.ListView.ItemInserted> event.
> [!IMPORTANT]
> This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see [Script Exploits Overview](https://msdn.microsoft.com/library/772c7312-211a-4eb3-8d6e-eec0aa1dcc07).
[!code-aspx-csharp[System.Web.UI.WebControls.ListView.ItemInserted#2](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.ItemInserted/CS/ListViewItemInsertedCS.aspx#2)]
[!code-aspx-vb[System.Web.UI.WebControls.ListView.ItemInserted#2](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.ItemInserted/VB/ListViewItemInsertedVB.aspx#2)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.ListView.InsertItem" />
<altmember cref="P:System.Web.UI.WebControls.ListView.InsertItemTemplate" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
</Docs>
</Member>
<Member MemberName="InsertItemTemplate">
<MemberSignature Language="C#" Value="public virtual System.Web.UI.ITemplate InsertItemTemplate { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Web.UI.ITemplate InsertItemTemplate" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.InsertItemTemplate" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property InsertItemTemplate As ITemplate" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Web::UI::ITemplate ^ InsertItemTemplate { System::Web::UI::ITemplate ^ get(); void set(System::Web::UI::ITemplate ^ value); };" />
<MemberSignature Language="F#" Value="member this.InsertItemTemplate : System.Web.UI.ITemplate with get, set" Usage="System.Web.UI.WebControls.ListView.InsertItemTemplate" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</AssemblyName>
<AssemblyVersion>3.5.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.ListViewItem), System.ComponentModel.BindingDirection.TwoWay)</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 custom content for an insert item in the <see cref="T:System.Web.UI.WebControls.ListView" /> control.</summary>
<value>An object that contains the custom content for the insert item in the <see cref="T:System.Web.UI.WebControls.ListView" /> control. The default is <see langword="null" />, which indicates that this property is not set.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Web.UI.WebControls.ListView.InsertItemTemplate%2A> property to define a custom user interface (UI) for the insert item in the <xref:System.Web.UI.WebControls.ListView> control. This UI is rendered either at the start or at the end of the displayed items. You specify where the UI is rendered by using the <xref:System.Web.UI.WebControls.ListView.InsertItemPosition%2A> property.
The <xref:System.Web.UI.WebControls.ListView.InsertItemTemplate%2A> template usually contains the input controls for the user to enter the values for a new record. It also usually contains buttons or hyperlinks to insert the record and to cancel the insert operation.
To specify the custom template declaratively, add an `InsertItemTemplate` element inside the `ListView` element. You can then add the contents of the template to the `InsertItemTemplate` element. You can associate a field with an input control by using a two-way binding expression. When a record is inserted, the <xref:System.Web.UI.WebControls.ListView> control automatically extracts the field value from the associated input control. For more information, see [Data-Binding Expressions Overview](https://msdn.microsoft.com/library/14cdd57d-0f82-4667-b503-73e1a96f136a).
To create buttons that perform the built-in cancel and insert operations, add a button control to the template. Set its <xref:System.Web.UI.WebControls.Button.CommandName%2A> property to one of the values listed in the following table.
|Button type|CommandName value|
|-----------------|-----------------------|
|Cancel|"Cancel"|
|Insert|"Insert"|
You can control the position of the insert item in the <xref:System.Web.UI.WebControls.ListView> control by using the <xref:System.Web.UI.WebControls.ListView.InsertItemPosition%2A> property.
## Examples
The following example shows how to define a custom template for the insert item of a <xref:System.Web.UI.WebControls.ListView> control. This code example is part of a larger example provided for the <xref:System.Web.UI.WebControls.ListView.ItemInserted> event.
> [!IMPORTANT]
> This example has a text box that accepts user input, which is a potential security threat. By default, ASP.NET Web pages validate that user input does not include script or HTML elements. For more information, see [Script Exploits Overview](https://msdn.microsoft.com/library/772c7312-211a-4eb3-8d6e-eec0aa1dcc07).
[!code-aspx-csharp[System.Web.UI.WebControls.ListView.ItemInserted#2](~/samples/snippets/csharp/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.ItemInserted/CS/ListViewItemInsertedCS.aspx#2)]
[!code-aspx-vb[System.Web.UI.WebControls.ListView.ItemInserted#2](~/samples/snippets/visualbasic/VS_Snippets_WebNet/System.Web.UI.WebControls.ListView.ItemInserted/VB/ListViewItemInsertedVB.aspx#2)]
]]></format>
</remarks>
<altmember cref="P:System.Web.UI.WebControls.ListView.InsertItem" />
<altmember cref="P:System.Web.UI.WebControls.ListView.InsertItemPosition" />
<altmember cref="P:System.Web.UI.WebControls.ListView.ItemTemplate" />
<altmember cref="P:System.Web.UI.WebControls.ListView.LayoutTemplate" />
<altmember cref="E:System.Web.UI.WebControls.ListView.ItemInserted" />
<altmember cref="E:System.Web.UI.WebControls.ListView.ItemInserting" />
<related type="Article" href="https://msdn.microsoft.com/library/8b4da934-2f5e-4b5a-b03d-fca5e15f85af">ListView Web Server Control</related>
<related type="Article" href="https://msdn.microsoft.com/library/14cdd57d-0f82-4667-b503-73e1a96f136a">Data-Binding Expression Syntax</related>
</Docs>
</Member>
<Member MemberName="InsertMethod">
<MemberSignature Language="C#" Value="public virtual string InsertMethod { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string InsertMethod" />
<MemberSignature Language="DocId" Value="P:System.Web.UI.WebControls.ListView.InsertMethod" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property InsertMethod As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::String ^ InsertMethod { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.InsertMethod : string with get, set" Usage="System.Web.UI.WebControls.ListView.InsertMethod" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web.Extensions</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>
<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.WebCategory("Data")</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.WebSysDescription("DataBoundControl_InsertMethod")</AttributeName>