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.

返回

数据源中的项数。

例外

dataSource 返回 null DataSourceView

-或-

dataSource 不是行 ICollection 计数,不能返回总行计数。

-或-

dataBindingfalsedataSource 不实现 ICollection 接口。

-或-

dataSource 不实现 ICollection 接口,并且 AllowPaging 设置为 true

注解

该方法 CreateChildControls 是由控件调用 DetailsView 的帮助程序方法,用于为控件创建控件层次结构。

继承者说明

扩展 DetailsView 类时,可以重写此方法以创建自己的控件层次结构。

适用于

另请参阅