Skip to main content

TableView.RowDetailsTemplate Property

Gets or sets a template used to display row details.

Namespace: DevExpress.Xpf.Grid

Assembly: DevExpress.Xpf.Grid.v24.2.dll

NuGet Package: DevExpress.Wpf.Grid.Core

Declaration

public DataTemplate RowDetailsTemplate { get; set; }

Property Value

Type Description
DataTemplate

A template used to display row details.

Remarks

Use the RowDetailsTemplate property to display custom content at the bottom of a row. The TableView.RowDetailsVisibilityMode property specifies how to display row details.

Run Demo: Table View Custom Templates

The template’s data context is a RowData object. Use the following binding path to access a property of an object in the ItemsSource collection: Row.[YourPropertyName].

The following code sample displays the employee information in the focused row’s details:

<Window.Resources>
    <DataTemplate x:Key="DetailCoreTemplate">
        <dx:MeasurePixelSnapper>
            <Grid Background="{dxi:ThemeResource {dxgt:TableViewThemeKey ResourceKey=EditFormBackground}}"
                  TextBlock.Foreground="{dxi:ThemeResource {dxgt:TableViewThemeKey ResourceKey=EditFormForeground}}">
                <Grid Margin="12">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Decorator MaxWidth="174" Width="{Binding Path=CellData[0].Column.ActualDataWidth}" Margin="-12,0,0,0">
                        <dxe:ImageEdit HorizontalAlignment="Left"
                                       VerticalAlignment="Top"
                                       Source="{Binding Path=Row.Photo}"
                                       Grid.Column="0"
                                       Margin="12,0"
                                       ShowMenu="False"
                                       IsReadOnly="True" />
                    </Decorator>
                    <Grid Grid.Column="1">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="12" />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <TextBlock Grid.Column="0" Grid.Row="0" Text="Name:" />
                        <TextBlock Grid.Column="0" Grid.Row="1" Text="Position:" />
                        <TextBlock Grid.Column="0" Grid.Row="2" Text="Hire Date:" />
                        <TextBlock Grid.Column="0" Grid.Row="3" Text="About:" />
                        <TextBlock Grid.Column="0" Grid.Row="4" Text="Address:" />
                        <TextBlock Grid.Column="2" Grid.Row="0" Text="{Binding Row.FirstName}" />
                        <TextBlock Grid.Column="2" Grid.Row="1" Text="{Binding Row.Title}" />
                        <TextBlock Grid.Column="2" Grid.Row="2" Text="{Binding Row.HireDate, StringFormat=D}" />
                        <TextBlock Grid.Column="2" Grid.Row="3" HorizontalAlignment="Left" Text="{Binding Row.Notes}" TextWrapping="Wrap" />
                        <TextBlock Grid.Column="2" Grid.Row="4" Text="{Binding Row.Address}" />
                    </Grid>
                </Grid>
            </Grid>
        </dx:MeasurePixelSnapper>
    </DataTemplate>
</Window.Resources>
<!-- -->
<dxg:GridControl.View>
    <dxg:TableView>
        <dxg:TableView.RowDetailsTemplate>
            <DataTemplate>
                <ContentControl Content="{Binding}" 
                                ContentTemplate="{StaticResource DetailCoreTemplate}"/>
            </DataTemplate>
        </dxg:TableView.RowDetailsTemplate>
    </dxg:TableView>
</dxg:GridControl.View>

The TableView.DataRowTemplate property overrides the RowDetailsTemplate property.

Refer to the following help topic for more information: Appearance Customization.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the RowDetailsTemplate property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also