GridControlBase.CustomGroupDisplayText Event

Enables you to provide custom content for group rows.

Namespace: DevExpress.UI.Xaml.Grid

Assembly: DevExpress.UI.Xaml.Grid.v18.1.dll

Declaration

public event CustomGroupDisplayTextEventHandler CustomGroupDisplayText
Public Event CustomGroupDisplayText As CustomGroupDisplayTextEventHandler

The event handler receives an argument of the DevExpress.UI.Xaml.Grid.CustomGroupDisplayTextEventHandler type.

You can group rows using custom rules by handling the GridControl.CustomColumnGroup event. In this instance, it may be useful to replace the default text displayed within group rows. To do this, handle the CustomGroupDisplayText event. The event arguments allow you to easily identify group rows and replace their display text.

Examples

This example shows how to group rows using custom rules. When grouping by the 'Unit Price' column, the rows in this column that have values between 0 and 10 should be combined into a single group. Rows whose values fall between 10 and 20 should be combined into another group, etc.

<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:HowToCustomGrouping"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Grid="using:DevExpress.UI.Xaml.Grid"
    x:Class="HowToCustomGrouping.MainPage"
    mc:Ignorable="d">
    <Grid>
        <Grid:GridControl Name="grid" CustomColumnGroup="GridControl_CustomColumnGroup" CustomGroupDisplayText="GridControl_CustomGroupDisplayText" Background="Black" Foreground="White" >
            <Grid:GridControl.Columns>
                <Grid:GridTextColumn FieldName="ProductName" />
                <Grid:GridTextColumn FieldName="Supplier" />
                <Grid:GridTextColumn FieldName="UnitPrice" SortMode="Custom"/>
                <Grid:GridTextColumn FieldName="Quantity" />
            </Grid:GridControl.Columns>
        </Grid:GridControl>
    </Grid>
</Page>

See Also