DynamicDataExtensions.EnablePersistedSelection(BaseDataBoundControl) 方法

定義

警告

Use the EnablePersistedSelection property on a databound control such as GridView or ListView.

啟用要保存於資料控制項中且支援選取和分頁的選項。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);
public static void EnablePersistedSelection (this 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
[<System.Obsolete("Use the EnablePersistedSelection property on a databound control such as GridView or ListView.")>]
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.

適用於