ListCollectionView.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)

属性值

描述集合中的项如何在视图中分组的对象集合 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)来设置此属性。 访问集合对象本身的属性是只读的;集合本身是可读/写的。

适用于

另请参阅