GridViewColumnHeader Class
Represents a column header for a GridViewColumn.
Assembly: PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
A GridViewColumnHeader object is a button control that is derived from ButtonBase. GridViewColumnHeader properties keep track of mouse events and the resizing of columns.
Column headers in a GridView view mode are GridViewColumnHeader objects.
You can customize GridViewColumnHeader objects by using a variety of properties that are found in this class and in related classes. For more information about these properties, and about the precedence between them, see GridView Column Header Styles and Templates Overview.
Content Model: GridViewColumnHeader is a ContentControl. Its content property is Content. For more information on the content model for GridViewColumnHeader, see Controls Content Model Overview.
Each GridViewColumnHeader can contain a context (right-click) menu. The following example shows how to create a context menu for a GridViewColumnHeader in XAML.
<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>
More Code
How to: Create a Style for a Dragged GridView Column Header | This example shows how to change the appearance of a dragged GridViewColumnHeader when the user changes the position of a column. |
System.Windows.Threading.DispatcherObject
System.Windows.DependencyObject
System.Windows.Media.Visual
System.Windows.UIElement
System.Windows.FrameworkElement
System.Windows.Controls.Control
System.Windows.Controls.ContentControl
System.Windows.Controls.Primitives.ButtonBase
System.Windows.Controls.GridViewColumnHeader
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.