New to Telerik UI for .NET MAUI? Start a free 30-day trial

Highlighting the Text in the DataGrid through Search Entry


Product Progress® Telerik® UI for .NET MAUI DataGrid
Product Version 3.2.1


How can I highlight a chunk of text inside a Telerik UI for .NET MAUI DataGrid cell when searching from an external UI?


Generally, to achieve the desired scenario, use a Telerik UI for .NET MAUI Entry control for the Searching UI.

To highlight the text in the DataGrid, use a CellTemplateColumn and add a RadHighlightLabel in it. Then, set the UnformattedText, HighlightText, and HighlightTextColor properties of the RadHighlight label to get the following result:

.NET MAUI DataGrid Highlighted Text

By binding the HighlightText property to the text value of the Entry you will be able to get the characters which need to be highlighted. The UnformattedText property must be bound to the ItemsSource propertys.

The following example shows the implementation the suggested approach.

<telerik:RadEntry x:Name="searchEntry"
                  Placeholder="Search Entry"/>
<telerik:RadDataGrid x:Name="dataGrid" AutomationId="dataGrid" AutoGenerateColumns="False">
        <telerik:DataGridTextColumn PropertyName="Country" HeaderText="HighlightedLabel">
                    <telerik:RadHighlightLabel UnformattedText="{Binding Country}"
                                               HighlightText="{Binding Source={x:Reference searchEntry}, Path=Text}"
In this article