ListView::View Property
.NET Framework (current version)
Gets or sets an object that defines how the data is styled and organized in a ListView control.
Assembly: PresentationFramework (in PresentationFramework.dll)
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 | None |
Note |
|---|
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.
<ListView.View> <GridView AllowsColumnReorder="true" ColumnHeaderToolTip="Employee Information"> <GridViewColumn DisplayMemberBinding= "{Binding Path=FirstName}" Header="First Name" Width="100"/> <GridViewColumn DisplayMemberBinding= "{Binding Path=LastName}" Width="100"> <GridViewColumnHeader>Last Name <GridViewColumnHeader.ContextMenu> <ContextMenu MenuItem.Click="LastNameCM_Click" Name="LastNameCM"> <MenuItem Header="Ascending" /> <MenuItem Header="Descending" /> </ContextMenu> </GridViewColumnHeader.ContextMenu> </GridViewColumnHeader> </GridViewColumn> <GridViewColumn DisplayMemberBinding= "{Binding Path=EmployeeNumber}" Header="Employee No." Width="100"/> </GridView> </ListView.View>
.NET Framework
Available since 3.0
Available since 3.0
Show:
