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.HighlightedGroupValueDisplayText Property

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

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public RenderFragment HighlightedGroupValueDisplayText { get; }

#Property Value

Type Description
RenderFragment

The highlighted group value display text.

#Remarks

The HighlightedGroupValueDisplayText 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 HighlightedGroupValueDisplayText property to get the highlighted group value display text in the template.

razor
<DxGrid Data="@Data" ShowSearchBox="true">
    <Columns>
        <DxGridDataColumn FieldName="CompanyName" SearchEnabled="false" />
        <DxGridDataColumn FieldName="Country" GroupIndex="0" >
            <GroupRowTemplate>
                <text>@context.ColumnCaption: @context.HighlightedGroupValueDisplayText</text>
                @{
                    var summaryItems = context.Grid.GetGroupSummaryItems();
                    if(summaryItems.Any()) {
                        <text> (</text>
                        foreach(var i in summaryItems) {
                            if(i != summaryItems.First()) {
                                <text>, </text>
                            }
                            @context.Grid.GetGroupSummaryLabel(i, context.VisibleIndex)
                            <text>: </text>
                            <b>@context.Grid.GetGroupSummaryFormattedValue(i, context.VisibleIndex)</b>
                        }
                        <text>)</text>
                    }
                }
            </GroupRowTemplate>
        </DxGridDataColumn>
        <DxGridDataColumn FieldName="City" SearchEnabled="false" />
        <DxGridDataColumn FieldName="UnitPrice" DisplayFormat="c" SearchEnabled="false" />
        <DxGridDataColumn FieldName="Quantity" SearchEnabled="false" />
    </Columns>
    <GroupSummary>
        <DxGridSummaryItem SummaryType="GridSummaryItemType.Sum" FieldName="Total" />
        <DxGridSummaryItem SummaryType="GridSummaryItemType.Count" FieldName="CompanyName" />
    </GroupSummary>
</DxGrid>

Search Box: Highlighted Group Value

You can use the HighlightedDisplayText property to get the full group row display text with a highlighted group value.

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

See Also