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

GridDataColumnGroupRowTemplateContext.HighlightedDisplayText Property

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

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
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).

razor
<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