ListView.EnablePersistedSelection Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value that indicates whether row selection persists when a user pages through data in a data-bound control.
public:
virtual property bool EnablePersistedSelection { bool get(); void set(bool value); };
public virtual bool EnablePersistedSelection { get; set; }
member this.EnablePersistedSelection : bool with get, set
Public Overridable Property EnablePersistedSelection As Boolean
Property Value
true
if row selection persists; otherwise, false
. The default is false
.
Remarks
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
.
Note
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.
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈