Files
docs-desktop/dotnet-desktop-guide/framework/wpf/controls/how-to-display-listview-contents-by-using-a-gridview.md
T
Andy De George da363692ff Initial WPF content migrated (#17)
* Reset branch for WPF changes

* Convert BMP to PNG; fix link-out-of-scope err

* Add snippets for WPF... 6794 files!!!!

* Add missing snippets

* update file updated between migration

* Fix paths to include

* update breadcrumb and toc

* fix index links

* fix index links

* fix index links

* fix markdown
2020-09-04 09:46:28 -07:00

1.7 KiB

title, ms.date, helpviewer_keywords, ms.assetid
title ms.date helpviewer_keywords ms.assetid
How to: Display ListView Contents by Using a GridView 03/30/2017
ListView controls [WPF], displaying contents with GridView
GridView [WPF], displaying ListView contents
5bc1e767-ab46-4f14-bd41-3d5d39e1d000

How to: Display ListView Contents by Using a GridView

This example shows how to define a xref:System.Windows.Controls.GridView view mode for a xref:System.Windows.Controls.ListView control.

Example

You can define the view mode of a xref:System.Windows.Controls.GridView by specifying xref:System.Windows.Controls.GridViewColumn objects. The following example shows how to define xref:System.Windows.Controls.GridViewColumn objects that bind to the data content that is specified for the xref:System.Windows.Controls.ListView control. This xref:System.Windows.Controls.GridView example specifies three xref:System.Windows.Controls.GridViewColumn objects that map to the FirstName, LastName, and EmployeeNumber fields of the EmployeeInfoDataSource that is set as the xref:System.Windows.Controls.ItemsControl.ItemsSource%2A of the xref:System.Windows.Controls.ListView control.

[!code-xamlListViewCode#ListViewEmployee]

The following illustration shows how this example appears.

Screenshot that shows a ListView with GridView output.

See also