DataGrid.CreateControlHierarchy(Boolean) 方法

定义

创建用于呈现 DataGrid 的控件层次结构。Creates the control hierarchy that is used to render the DataGrid.

protected:
 override void CreateControlHierarchy(bool useDataSource);
protected override void CreateControlHierarchy (bool useDataSource);
override this.CreateControlHierarchy : bool -> unit
Protected Overrides Sub CreateControlHierarchy (useDataSource As Boolean)

参数

useDataSource
Boolean

是使用数据源自动生成列还是使用保存状态。Whether to use the data source to generate columns automatically or to use saved state.

异常

useDataSourcetrue,没有设置 VirtualItemCount 的值,且所选数据源未实现 ICollection 接口。useDataSource is true, the value of VirtualItemCount is not set, and the selected data source does not implement the ICollection interface.

-或--or- useDataSourcetrue,数据源具有有效的 CurrentPageIndex 属性。useDataSource is true and the data source has an invalid CurrentPageIndex property.

注解

此实现假定已经清除了控件集合中的所有子级。This implementation assumes that all the children in the controls collection have already been cleared.

适用于