내보내기(0) 인쇄
모두 확장

GridView.ColumnHeaderContainerStyle 속성

Gets or sets the style to apply to column headers.

네임스페이스: System.Windows.Controls
어셈블리: PresentationFramework(presentationframework.dll)
XML 네임스페이스:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public Style ColumnHeaderContainerStyle { get; set; }
/** @property */
public Style get_ColumnHeaderContainerStyle ()

/** @property */
public void set_ColumnHeaderContainerStyle (Style value)

public function get ColumnHeaderContainerStyle () : Style

public function set ColumnHeaderContainerStyle (value : Style)

<object ColumnHeaderContainerStyle="{ResourceExtension StyleResourceKey}"/>
 ResourceExtension  One of the following: StaticResource, or DynamicResource. See Resources Overview.  StyleResourceKey  The key that identifies the style being requested. The key refers to an existing resource in a ResourceDictionary. 

속성 값

The Style that is used to define the display properties for column headers. The default value is null 참조(Visual Basic의 경우 Nothing).

Identifier field

ColumnHeaderContainerStyleProperty

Metadata properties set to true

None

The ColumnHeaderContainerStyle property and the ColumnHeaderTemplate property are both used to define the visual tree for the GridViewColumnHeader objects that represent the column headers in a GridView. The ColumnHeaderContainerStyle property can also define column header content when a ColumnHeaderTemplate is not by specified by defining a ControlTemplate for the GridViewColumnHeader object.

This property represents one of several ways to lay out and style column headers. For more information, see GridView Column Header Styles and Templates Overview.

When you set styles, there are some restrictions. For more information, see Styles Overview.

The following example shows how to define the ColumnHeaderContainerStyle property. For the complete sample, see ListView implementing a GridView with Templates.

<Style x:Key="myHeaderStyle" TargetType="{x:Type GridViewColumnHeader}">
  <Setter Property="Background" Value="LightBlue"/>
</Style>

<GridView ColumnHeaderTemplate="{StaticResource myHeaderTemplate}"
          ColumnHeaderContainerStyle="{StaticResource myHeaderStyle}">
  <GridViewColumn Header="Year" Width="80"
        CellTemplate="{StaticResource myCellTemplateYear}"/>
  <GridViewColumn Header="Month" Width="80"
        CellTemplate="{StaticResource myCellTemplateMonth}"/>
  <GridViewColumn Header="Day" Width="80"
        CellTemplate="{StaticResource myCellTemplateDay}"/>
</GridView>

Microsoft .NET Framework 3.0은 Windows Vista, Microsoft Windows XP SP2 및 Windows Server 2003 SP1에서 지원됩니다.

.NET Framework

3.0에서 지원

커뮤니티 추가 항목

추가
표시:
© 2014 Microsoft