GridViewHeaderItem GridViewHeaderItem GridViewHeaderItem Class

Represents items in the header for grouped data inside a GridView.

Syntax

Declaration

public class GridViewHeaderItempublic class GridViewHeaderItemPublic Class GridViewHeaderItem

Inheritance Hierarchy

Inherited Members

Inherited properties

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Tag
Tag
Tag
, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Inherited events

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Inherited methods

, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Remarks

GridViewHeaderItem is a control that's created by the system and added to the visual tree when the data templates for a grouped ListView are realized. Specifically, it's created when realizing the HeaderTemplate. You don't typically define elements for GridViewHeaderItem in XAML. There's a default template for GridViewHeaderItem as part of the built-in templates. The main app scenario for the GridViewHeaderItem class is to copy and replace the default style and template with a style of your own, which also implicitly targets GridViewHeaderItem.

There's a dedicated automation peer class for GridViewHeaderItem, GridViewHeaderItemAutomationPeer. This is because after the GridView is realized, all the created item parts need automation representation, so that Microsoft UI Automation can report them in the tree it provides for assistive technology and other Microsoft UI Automation clients.

If you use the HeaderContainerStyle property, the Style it contains must have a TargetType value of either ListViewHeaderItem or GridViewHeaderItem.

Control style and template

You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about modifying a control's style and template, see Styling controls. The default style, template, and resources that define the look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP<SDK version>\Generic folder from a Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might have different values.

Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml includes resources that you can use to modify the colors of a control in different visual states without modifying the control template. In apps that target this software development kit (SDK) or later, modifying these resources is preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling section of the Styling controls article.

This table shows the resources used by the GridViewHeaderItem control.

Resource keyDescription
GridViewHeaderItemBackgroundItem background color
GridViewHeaderItemDividerStrokeDivider line color

Constructors summary

Initializes a new instance of the GridViewHeaderItem class.

Constructors

  • GridViewHeaderItem()
    GridViewHeaderItem()
    GridViewHeaderItem()
    GridViewHeaderItem()

    Initializes a new instance of the GridViewHeaderItem class.

    public GridViewHeaderItem()public New()Public Sub New()public GridViewHeaderItem()

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ComposableAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute

Details

Assembly

Windows.UI.Xaml.Controls.dll