DataPager.CreatePagerFields 方法


建立由 DataPagerField 控制項的 Fields 屬性所包含的 DataPager 物件。Creates the DataPagerField objects that are contained by the Fields property of the DataPager control.

 virtual void CreatePagerFields();
protected virtual void CreatePagerFields ();
abstract member CreatePagerFields : unit -> unit
override this.CreatePagerFields : unit -> unit
Protected Overridable Sub CreatePagerFields ()


PageSize 屬性和 OnTotalRowCountAvailable 方法會使用 CreatePagerFields 方法,來建立 Fields 屬性所包含的 DataPagerField 物件。The CreatePagerFields method is used by the PageSize property and by the OnTotalRowCountAvailable method to create the DataPagerField objects that are contained by the Fields property. 這個方法會呼叫 DataPagerField.CreateDataPagers 方法,針對集合中的每個欄位建立使用者介面(UI)控制項。This method calls the DataPagerField.CreateDataPagers method to create the user interface (UI) controls for each field in the collection.

在 [DataPager] 控制項中建立的分頁欄位,會以分頁程式欄位出現在 Fields 集合中的順序排列。The pager fields are created in the DataPager control in the order that the pager fields appear in the Fields collection. 下表顯示從 DataPagerField 類別衍生,而且可以在 DataPager 控制項中建立的頁面分頁類別。The following table shows the pager field classes that derive from the DataPagerField class and that can be created in the DataPager control.

呼機欄位類型Pager field type 描述Description
NextPreviousPagerField 可讓使用者一次流覽一頁的資料頁面,或跳到資料的第一個或最後一頁。Enables users to navigate through pages of data one page at a time, or to jump to the first or last page of data.
NumericPagerField 可讓使用者依頁碼選取資料頁面。Enables users to select a page of data by page number.
TemplatePagerField 可讓您建立自訂分頁 UI。Enables you to create a custom paging UI.