DetailsView.CreateChildControls(IEnumerable, Boolean) 方法

定義

建立用來呈現 DetailsView 控制項的控制階層架構。

protected:
 override int CreateChildControls(System::Collections::IEnumerable ^ dataSource, bool dataBinding);
protected override int CreateChildControls (System.Collections.IEnumerable dataSource, bool dataBinding);
override this.CreateChildControls : System.Collections.IEnumerable * bool -> int
Protected Overrides Function CreateChildControls (dataSource As IEnumerable, dataBinding As Boolean) As Integer

參數

dataSource
IEnumerable

IEnumerable,表示 DetailsView 控制項的資料來源。

dataBinding
Boolean

true 表示此方法是在資料繫結期間呼叫,否則為 false

傳回

Int32

資料來源中的項目數目。

例外狀況

dataSource 會傳回 null DataSourceView

-或-

dataSource 不是 ICollection 且無法傳回資料列總數。

-或-

dataBindingfalsedataSource 不會實作 ICollection 介面。

-或-

dataSource 不會實作 ICollection 介面,且 AllowPaging 設為 true

備註

方法是 CreateChildControls 控制項所 DetailsView 呼叫的協助程式方法,可建立控制項的控制項階層。

給繼承者的注意事項

擴充 DetailsView 類別時,您可以覆寫這個方法以建立您自己的控制項階層。

適用於

另請參閱