ListViewSelectEventArgs Class
Provides data for the SelectedIndexChanging event.
System::EventArgs
System.ComponentModel::CancelEventArgs
System.Web.UI.WebControls::ListViewSelectEventArgs
Assembly: System.Web.Extensions (in System.Web.Extensions.dll)
The ListViewSelectEventArgs type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | ListViewSelectEventArgs | Initializes a new instance of the ListViewSelectEventArgs class. |
| Name | Description | |
|---|---|---|
![]() | Cancel | Gets or sets a value indicating whether the event should be canceled. (Inherited from CancelEventArgs.) |
![]() | NewSelectedIndex | Gets or sets the index of the new item to select in the ListView control. |
| Name | Description | |
|---|---|---|
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
The ListView control raises the SelectedIndexChanging event when a Select button is clicked, but before the ListView control handles the select operation. (A Select a button is one whose CommandName property is set to "Select".) This enables you to provide an event-handling method that performs a custom routine whenever this event occurs, such as canceling the select operation.
A ListViewSelectEventArgs object is passed to the event-handling method, which enables you to determine the index of the item that is selected by the user. It also enables you to cancel the select operation. To cancel the select operation, set the Cancel property of the ListViewSelectEventArgs object to true.
For a list of initial property values for an instance of the ListViewSelectEventArgs class, see the ListViewSelectEventArgs constructor.
The following example shows how to use the ListViewSelectEventArgs object that is passed to the SelectedIndexChanging event to cancel the select operation if the item that was selected is discontinued.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.


