BindingListCollectionView.GroupDescriptions 属性

定义

获取 GroupDescription 对象的集合,这些对象描述集合中的项在视图中的分组方式。

public:
 virtual property System::Collections::ObjectModel::ObservableCollection<System::ComponentModel::GroupDescription ^> ^ GroupDescriptions { System::Collections::ObjectModel::ObservableCollection<System::ComponentModel::GroupDescription ^> ^ get(); };
public override System.Collections.ObjectModel.ObservableCollection<System.ComponentModel.GroupDescription> GroupDescriptions { get; }
member this.GroupDescriptions : System.Collections.ObjectModel.ObservableCollection<System.ComponentModel.GroupDescription>
Public Overrides ReadOnly Property GroupDescriptions As ObservableCollection(Of GroupDescription)

属性值

ObservableCollection<GroupDescription>

GroupDescription 对象的集合,这些对象描述集合中的项在视图中的分组方式。

示例

以下示例演示如何使用此属性:

// This groups the items in the view by the property "Category"
PropertyGroupDescription groupDescription = new PropertyGroupDescription();
groupDescription.PropertyName = "Category";
listingDataView.GroupDescriptions.Add(groupDescription);
'This groups by property "Category"
Dim groupDescription As PropertyGroupDescription = New PropertyGroupDescription
groupDescription.PropertyName = "Category"
listingDataView.GroupDescriptions.Add(groupDescription)

有关完整示例,请参阅 数据绑定演示

注解

备注

只能通过访问集合对象并使用其各种方法(如 Add)来设置此属性。 访问集合对象本身的属性是只读的;集合本身是可读/写的。

适用于

另请参阅