Skip to main content

GridDataColumnCellDisplayTemplateContext.HighlightedDisplayText Property

Returns the cell’s display text with highlighted search text (if any).

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.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 cell display text (DisplayText). Use the HighlightedDisplayText property to get the display text that can be highlighted by search.

<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