Skip to main content

GridDataColumnGroupRowTemplateContext.HighlightedDisplayText Property

Returns the group row display text with highlighted search text (if any).

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v23.2.dll

NuGet Package: DevExpress.Blazor

Declaration

public RenderFragment HighlightedDisplayText { get; }

Property Value

Type Description
RenderFragment

A delegate that returns the highlighted display text.

Remarks

The HighlightedDisplayText property is in effect if you use the search feature in the Grid component.

The grid searches and filters data by value display text (GroupValueDisplayText). Use the HighlightedDisplayText property to get the full group row display text with the highlighted group value (if any).

<DxGrid @ref="Grid" Data="@Data" PageSize="6" ShowSearchBox="true">
    <Columns>
        <DxGridDataColumn FieldName="OrderDate" GroupIndex="0" >
            <GroupRowTemplate>
                <text>@context.HighlightedDisplayText </text>
                    @{
                        bool state = GetProcessState(context.GroupValue);
                        if (state) {
                            <span style="color:green"> - processed</span>
                        } else {
                            <span style="color:red"> - unprocessed</span> 
                        }
                    }
            </GroupRowTemplate>
        </DxGridDataColumn>
        <DxGridDataColumn FieldName="CompanyName" />
        <DxGridDataColumn FieldName="Country" />
        <DxGridDataColumn FieldName="UnitPrice" DisplayFormat="c" />
        <DxGridDataColumn FieldName="Quantity" />
        <DxGridDataColumn FieldName="Total" UnboundType="GridUnboundColumnType.Decimal" 
                          UnboundExpression="[UnitPrice]*[Quantity]" DisplayFormat="c" />
    </Columns>
    <GroupSummary>
        <DxGridSummaryItem SummaryType="GridSummaryItemType.Sum" FieldName="Total" />
    </GroupSummary>
</DxGrid>

Grid Group Row Template

To implement custom display text for a group row, use the HighlightedGroupValueDisplayText property, which returns the highlighted group value display text.

For more information about search in the Grid component, refer to the following topic: Search Box in Blazor Grid.

See Also