Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DataGridView.GroupCaptionTemplate Property

Gets or sets the template that defines the visual representation of a group row caption. This is a bindable property.

Namespace: DevExpress.Maui.DataGrid

Assembly: DevExpress.Maui.DataGrid.dll

NuGet Package: DevExpress.Maui.DataGrid

#Declaration

C#
public DataTemplate GroupCaptionTemplate { get; set; }

#Property Value

Type Description
DataTemplate

A template for group row captions.

#Remarks

When data is grouped, the grid displays group rows to separate groups of data rows. End users can tap group rows to expand and collapse groups.

A group row displays the following elements:

  • Collapse Icon - Indicates whether the group is collapsed or expanded.
  • Grouping Column - A caption of a column by whose values data is grouped.
  • Group Row Value - A data value for which the group is created.
  • Group Summary - A group summary value.

Grid Group Rows

The grid’s GroupCaptionTemplate or particular column’s GroupCaptionTemplate properties allow you to define a custom template for a group row caption (it includes a column caption and data value in the default structure of a group row).

<dxg:DataGridView ... >
    <dxg:DataGridView.GroupCaptionTemplate>
        <DataTemplate>
            <dx:DXStackLayout Orientation="Vertical">
                <Label Text="{Binding Path=GroupValueText}"/>  
            </dx:DXStackLayout>
        </DataTemplate>
    </dxg:DataGridView.GroupCaptionTemplate>
</dxg:DataGridView>

You can also specify templates for a group summary (DataGridView.GroupSummaryTemplate) or the whole group row (DataGridView.GroupRowTemplate). The GroupRowData class specifies the binding context for these templates.

See Also