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)


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.


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.


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


    <Style TargetType="data:DataGridRowGroupHeader">
        <Setter Property="ItemCountVisibility" Value="Collapsed" />

Version Information


Supported in: 5, 4, 3


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