Skip to main content

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

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.

<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