DataSet.DefaultViewManager 属性

定义

获取 DataSet 所包含的数据的自定义视图,以允许使用自定义的 DataViewManager 进行筛选、搜索和导航。Gets a custom view of the data contained in the DataSet to allow filtering, searching, and navigating using a custom DataViewManager.

public:
 property System::Data::DataViewManager ^ DefaultViewManager { System::Data::DataViewManager ^ get(); };
[System.ComponentModel.Browsable(false)]
[System.Data.DataSysDescription("DataSetDefaultViewDescr")]
public System.Data.DataViewManager DefaultViewManager { get; }
member this.DefaultViewManager : System.Data.DataViewManager
Public ReadOnly Property DefaultViewManager As DataViewManager

属性值

一个 DataViewManager 对象。A DataViewManager object.

属性

示例

下面的示例获取 DataSet的默认 DataViewManager,并将 DataTable 添加到 DataTableCollectionThe following example gets the default DataViewManager for a DataSet, and adds a DataTable to the DataTableCollection.

Private Sub GetDefaultDataViewManager()
    ' Get a DataSet object's DefaultViewManager.
     Dim view As DataViewManager = DataSet1.DefaultViewManager

    ' Add a DataTable to the DataTableCollection.
    Dim table As DataTable
    table = New DataTable("TableName")
    view.DataSet.Tables.Add(table)
End Sub

注解

DefaultViewManager 属性返回的 DataViewManager 允许您为 DataSet中的每个 DataTable 创建自定义设置。The DataViewManager returned by the DefaultViewManager property allows you to create custom settings for each DataTable in the DataSet.

DataTable中获取 DataView 时,将根据 DefaultViewManager 属性中的设置来配置排序顺序、筛选和 DataViewRowStateWhen you obtain a DataView from a DataTable, the sort order, filtering, and DataViewRowState are configured according to the settings in the DefaultViewManager property.

适用于

另请参阅