Export (0) Print
Expand All

ListViewItemEventArgs Class

Provides data for the ItemCreated and ItemDataBound events.


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

type ListViewItemEventArgs =  
        inherit EventArgs 

The ListViewItemEventArgs type exposes the following members.

Public methodListViewItemEventArgsInitializes a new instance of the ListViewItemEventArgs class.

Public propertyItemGets the item that is being created or bound to data.

Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

Before the ListView control can be rendered, a ListViewItem object must be created for each item in the control. The ItemCreated event is raised every time that an item in the ListView control is created. This enables you to provide an event-handling method that performs a custom routine whenever an item is created, such as adding custom content to an item.

Similarly, before the ListView control can be rendered, every item in the control must be bound to a record in the data source. The ItemDataBound event is raised when an item (represented by a ListViewItem object) is bound to data in the ListView control. This enables you to perform a custom routine whenever an item is bound to data, such as modifying the values of the data before they are displayed.

A ListViewItemEventArgs object is passed to the event-handling method, which enables you to access the properties of the item that raised the event. To determine which item type (data item, empty item, or insert item) is being created, use the ItemType property of the ListViewItem object.

For a list of initial property values for an instance of ListViewItemEventArgs, see the ListViewItemEventArgs constructor.

The following example shows how to use the ListViewItemEventArgs object to access the properties of the item that is being bound to data.

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

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2014 Microsoft