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

GridDataColumnCellDisplayTemplateContext.HighlightedDisplayText Property

Returns the cell’s 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 cell display text (DisplayText). Use the HighlightedDisplayText property to get the display text that can be highlighted by search.

razor
<DxGrid Data="DataSource" ShowSearchBox="true">
    <Columns>
        <DxGridDataColumn FieldName="LastName" >
            <CellDisplayTemplate>
                @{
                    var item = (Employee)context.DataItem;
                    <text>@item.TitleOfCourtesy @context.HighlightedDisplayText</text>
                }
            </CellDisplayTemplate>
        </DxGridDataColumn>
        <DxGridDataColumn FieldName="Title"/>
        <DxGridDataColumn FieldName="BirthDate" />
    </Columns>
</DxGrid>

Grid Cell Template - Highlight Display Text

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

See Also