ListView.View Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets an object that defines how the data is styled and organized in a ListView control.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

Public Property View As ViewBase

Property Value

Type: System.Windows.Controls.ViewBase

A ViewBase object that specifies how to display information in the ListView.

The .NET Framework environment includes the configurable view mode named GridView. You can also create a custom view that inherits from ViewBase. For more information, see How to: Create a Custom View Mode for a ListView.

Identifier field


Metadata properties set to true



The type of property metadata for this property is PropertyMetadata, not FrameworkPropertyMetadata.

The following example shows how to specify a GridView object as the View for a ListView control.

Dim myListView As New ListView()

Dim myGridView As New GridView()
myGridView.AllowsColumnReorder = True
myGridView.ColumnHeaderToolTip = "Employee Information"

Dim gvc1 As New GridViewColumn()
gvc1.DisplayMemberBinding = New Binding("FirstName")
gvc1.Header = "FirstName"
gvc1.Width = 100
Dim gvc2 As New GridViewColumn()
gvc2.DisplayMemberBinding = New Binding("LastName")
gvc2.Header = "Last Name"
gvc2.Width = 100
Dim gvc3 As New GridViewColumn()
gvc3.DisplayMemberBinding = New Binding("EmployeeNumber")
gvc3.Header = "Employee No."
gvc3.Width = 100

'ItemsSource is ObservableCollection of EmployeeInfo objects
myListView.ItemsSource = New myEmployees()
myListView.View = myGridView

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

    <GridViewColumn DisplayMemberBinding=
                        "{Binding Path=FirstName}" 
                    Header="First Name" Width="100"/>

                <GridViewColumn DisplayMemberBinding=
                        "{Binding Path=LastName}" 
                    <GridViewColumnHeader>Last Name
                        <ContextMenu  MenuItem.Click="LastNameCM_Click"  
                            <MenuItem Header="Ascending" />
                            <MenuItem Header="Descending" />

                <GridViewColumn DisplayMemberBinding=
                        "{Binding Path=EmployeeNumber}" 
                    Header="Employee No." Width="100"/>


.NET Framework
Available since 3.0
Return to top