--- title: "How to: Group Items in a ListView That Implements a GridView" ms.date: "03/30/2017" helpviewer_keywords: - "ListView controls [WPF], grouping items with GridViews" - "grouping items in ListViews implementing GridViews [WPF]" - "GridView controls [WPF], grouping items" ms.assetid: eebef25b-ddc6-424e-a66d-ea228d1bf33d --- # How to: Group Items in a ListView That Implements a GridView This example shows how to display groups of items in the view mode of a control. ## Example To display groups of items in a , define a . The following example shows a that groups data items according to the value of the `Catalog` data field. [!code-xaml[GridViewWithGroups#GroupingCollectionViewSource](~/samples/snippets/csharp/VS_Snippets_Wpf/GridViewWithGroups/CS/Window1.xaml#groupingcollectionviewsource)] The following example sets the for the to the that the previous example defines. The example also defines a that implements an control. [!code-xaml[GridViewWithGroups#ListViewGroups](~/samples/snippets/csharp/VS_Snippets_Wpf/GridViewWithGroups/CS/Window1.xaml#listviewgroups)] [!code-xaml[GridViewWithGroups#ListViewEnd](~/samples/snippets/csharp/VS_Snippets_Wpf/GridViewWithGroups/CS/Window1.xaml#listviewend)] ## See also - - - [How-to Topics](listview-how-to-topics.md) - [ListView Overview](listview-overview.md) - [GridView Overview](gridview-overview.md)