Partager via


DataGridRowGroupHeader.PropertyNameVisibility Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets a value that indicates whether the property name is visible.

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

Syntax

'Declaration
Public Property PropertyNameVisibility As Visibility
public Visibility PropertyNameVisibility { get; set; }

Property Value

Type: System.Windows.Visibility
An enumeration value that indicates whether the property name is visible. The default is Visible.

Remarks

Dependency property identifier field: PropertyNameVisibilityProperty

By default, the PropertyName is displayed in the row group header. To prevent this value from being displayed, you set the PropertyNameVisibility property to Collapsed.

You typically do not access the DataGridRowGroupHeader directly in your code. Instead, you set its properties in a Style with a TargetType of DataGridRowGroupHeader and add the Style to the RowGroupHeaderStyles collection.

Examples

The following example demonstrates how to set the PropertyNameVisibility property in a Style. The Style is added to the RowGroupHeaderStyles collection.

[XAML]

<data:DataGrid.RowGroupHeaderStyles>
    <Style TargetType="data:DataGridRowGroupHeader">
        <Setter Property="PropertyNameVisibility" Value="Collapsed" />
    </Style>
</data:DataGrid.RowGroupHeaderStyles>

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.