Skip to main content
All docs
V26.1
  • TableView.MasterDetailExpandGlyphTemplate Property

    Gets or sets the template used to display the expand glyph in master-detail rows. This is a dependency property.

    Namespace: DevExpress.Xpf.Grid

    Assembly: DevExpress.Xpf.Grid.v26.1.dll

    Declaration

    public DataTemplate MasterDetailExpandGlyphTemplate { get; set; }

    Property Value

    Type Description
    DataTemplate

    A DataTemplate that displays the expand glyph in master-detail rows.

    Remarks

    Assign a DataTemplate to the MasterDetailExpandGlyphTemplate property to replace the icon displayed when a master row is collapsed. To replace the predefined glyph, use the MasterDetailCollapseGlyphTemplate property.

    Supported Themes

    The MasterDetailExpandGlyphTemplate property supports the following themes:

    Example: Customize Master-Detail Expand and Collapse Glyphs

    The following example assigns arrow icons as expand and collapse glyphs for master-detail rows:

    Master Detail - Expand and Collapse Glyphs

    <dx:ThemedWindow xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
                     xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid">
        <dx:ThemedWindow.Resources>
            <DataTemplate x:Key="MasterExpandTemplate">
                <Path Data="M 0,0 L 8,4 L 0,8 Z"
                      Fill="{Binding Path=(TextBlock.Foreground), RelativeSource={RelativeSource AncestorType=ContentPresenter}}"
                      HorizontalAlignment="Center" VerticalAlignment="Center"/>
            </DataTemplate>
            <DataTemplate x:Key="MasterCollapseTemplate">
                <Path Data="M 0,0 L 8,0 L 4,8 Z"
                      Fill="{Binding Path=(TextBlock.Foreground), RelativeSource={RelativeSource AncestorType=ContentPresenter}}"
                      HorizontalAlignment="Center" VerticalAlignment="Center"/>
            </DataTemplate>
        </dx:ThemedWindow.Resources>
    
        <dxg:GridControl ItemsSource="{Binding Customers}">
            <dxg:GridControl.View>
                <dxg:TableView MasterDetailExpandGlyphTemplate="{StaticResource MasterExpandTemplate}"
                               MasterDetailCollapseGlyphTemplate="{StaticResource MasterCollapseTemplate}"/>
            </dxg:GridControl.View>
            <dxg:GridControl.DetailDescriptor>
                <dxg:DataControlDetailDescriptor ItemsSourcePath="Orders">
                    <dxg:DataControlDetailDescriptor.DataControl>
                        <dxg:GridControl>
                            <dxg:GridControl.View>
                                <dxg:TableView ShowGroupPanel="False"/>
                            </dxg:GridControl.View>
                        </dxg:GridControl>
                    </dxg:DataControlDetailDescriptor.DataControl>
                </dxg:DataControlDetailDescriptor>
            </dxg:GridControl.DetailDescriptor>
        </dxg:GridControl>
    </dx:ThemedWindow>
    
    See Also