DynamicDataExtensions.EnablePersistedSelection(BaseDataBoundControl) 方法

定义

警告

此 API 现已过时。

使选定内容能够保留在支持选择和分页的数据控件中。Enables selection to be persisted in data controls that support selection and paging.

public:
[System::Runtime::CompilerServices::Extension]
 static void EnablePersistedSelection(System::Web::UI::WebControls::BaseDataBoundControl ^ dataBoundControl);
[System.Obsolete("Use the EnablePersistedSelection property on a databound control such as GridView or ListView.")]
public static void EnablePersistedSelection (this System.Web.UI.WebControls.BaseDataBoundControl dataBoundControl);
static member EnablePersistedSelection : System.Web.UI.WebControls.BaseDataBoundControl -> unit
<Extension()>
Public Sub EnablePersistedSelection (dataBoundControl As BaseDataBoundControl)

参数

dataBoundControl
BaseDataBoundControl

数据绑定控件。The data bound control.

属性

注解

在扩展BaseDataBoundControl并支持选择、分页和排序的控件中,调用此方法会使控件即使在所选行不可见时也能持久保存。In controls that extend BaseDataBoundControl and that support selection, paging, and sorting, calling this method enables the control to persist selection even when the selected row is not visible. 例如,如果用户选择某行,然后选择页到另一个页面,或用户对数据进行排序,则所选行仍将保持选中状态。For example, if the user selects a row and then pages to another page, or if the user sorts the data, the selected row remains selected. 如果未调用此方法,则在用户页或对其进行排序时,选择将丢失。If this method is not called, selection is lost when the user pages or sorts.

RegisterControl 方法调用 EnablePersistedSelectionThe RegisterControl method calls EnablePersistedSelection.

适用于