ListViewItem::ItemType Property

 

Gets the item type of the ListViewItem object.

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

public:
property ListViewItemType ItemType {
	ListViewItemType get();
}

Property Value

Type: System.Web.UI.WebControls::ListViewItemType

One of the ListViewItemType values.

Use the ItemType property to determine the type of item that the ListViewItem object represents, as listed in the following table.

Item type

Description

DataItem

A data item in the ListView control.

InsertItem

An insert item in the ListView control.

EmptyItem

An empty item in the ListView control. The empty item is displayed when the ListView control does not have any records to display, or when a group in the ListView control does not have any more records to display.

You typically use this property to determine an item's type before you perform an operation.

The following example shows how to use the ItemType property to determine whether the item that is being created is a data item. If the item is a data item, the e-mail address is displayed in italic. This code example is part of a larger example provided for the ListViewItem class.

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

.NET Framework
Available since 3.5
Return to top
Show: