Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

ListView.EnablePersistedSelection Property

Gets or sets a value that indicates whether row selection persists when a user pages through data in a data-bound control.

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web.Extensions (in System.Web.Extensions.dll)
abstract EnablePersistedSelection : bool with get, set 
override EnablePersistedSelection : bool with get, set
<asp:ListView EnablePersistedSelection="True|False" />

Property Value

Type: System.Boolean
true if row selection persists; otherwise, false. The default is false.

You can specify how selected rows are persisted when the 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.

NoteNote

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.

.NET Framework

Supported in: 4.5.1, 4.5, 4

Windows Phone 8.1, Windows Phone 8, 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.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.