Share via


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。 存取集合物件本身的屬性是唯讀的;集合本身是可讀寫的。

適用於

另請參閱