This documentation is archived and is not being maintained.

ListViewSelectEventArgs::NewSelectedIndex Property

Gets or sets the index of the new item to select in the ListView control.

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

public:
property int NewSelectedIndex {
	int get ();
	void set (int value);
}

Property Value

Type: System::Int32
The index of the new item to select in the ListView control.

The ListView::SelectedIndexChanging event occurs before the ListView control performs the select operation. Therefore, you cannot use the ListView::SelectedIndex property of the control to determine the index of the new item selected by the user. The ListView::SelectedIndex property contains the index of the previously selected item. To determine the index of the new item that is selected by the user, use the NewSelectedIndex property. You can also use this property to programmatically override the selected item index by setting it to another value.

The following example shows how to use the NewSelectedIndex property of the ListViewSelectEventArgs object to access the item that was selected by the user.

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

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

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

.NET Framework

Supported in: 3.5
Show: