Partager via


DataGridRowGroupHeader.ItemCountVisibility Property

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

Gets or sets a value that indicates whether the item count is visible.

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

Syntax

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

Property Value

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

Remarks

Dependency property identifier field: ItemCountVisibilityProperty

By default, the number of items in the group is displayed in the row group header. To prevent this value from being displayed, you set the ItemCountVisibility 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 ItemCountVisibility property in a Style. The Style is added to the RowGroupHeaderStyles collection.

[XAML]

<data:DataGrid.RowGroupHeaderStyles>
    <Style TargetType="data:DataGridRowGroupHeader">
        <Setter Property="ItemCountVisibility" 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.