Partager via


DataGridRowGroupHeader.SublevelIndent Property

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

Gets or sets a value that indicates the amount that the immediate children of the DataGridRowGroupHeader are indented.

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

Syntax

'Declaration
Public Property SublevelIndent As Double
public double SublevelIndent { get; set; }

Property Value

Type: System.Double
The amount that the immediate children of the DataGridRowGroupHeader are indented. The default is 20.

Exceptions

Exception Condition
ArgumentException

The specified value is NaN, PositiveInfinity, or NegativeInfinity.

ArgumentOutOfRangeException

The specified value is less than 0.

Remarks

Dependency property identifier field: SublevelIndentProperty

If a DataGrid has multiple levels of grouping, you can specify the amount that sub-groups are indented by setting the SublevelIndent property. The value is in pixels.

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 SublevelIndent property in a Style. The Style is added to the RowGroupHeaderStyles collection.

[XAML]

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