The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

How to: Display ListView Contents by Using a GridView

This example shows how to define a GridView view mode for a ListView control.


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

<ListView ItemsSource="{Binding Source=
                       {StaticResource EmployeeInfoDataSource}}">


    <GridView AllowsColumnReorder="true"
              ColumnHeaderToolTip="Employee Information">

      <GridViewColumn DisplayMemberBinding=
                          "{Binding Path=FirstName}" 
                      Header="First Name" Width="100"/>
      <GridViewColumn DisplayMemberBinding=
                          "{Binding Path=LastName}" 
                      Header="Last Name" Width="100"/>
      <GridViewColumn DisplayMemberBinding=
                          "{Binding Path=EmployeeNumber}" 
                      Header="Employee No." Width="100"/>


The following illustration shows how this example appears.

ListView with GridView output

For the complete sample, see ListView That Uses a GridView View Sample.

See Also

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft