This is a migrated thread and some comments may be shown as answers.

HighlightTextBlock - bold search result

3 Answers 174 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Heiko
Top achievements
Rank 1
Iron
Veteran
Heiko asked on 13 Jul 2020, 03:51 PM

Hi,

I would like to style the search results that are displayed in HighlightTextBlock so that the found text is bold or underlined or similar. Any simple solution for that?

Regards
Heiko

3 Answers, 1 is accepted

Sort by
0
Vicky
Telerik team
answered on 16 Jul 2020, 11:47 AM

Hello Heiko,

To style the HighlightTextBlock of the RadGridView, you can define a Style, similar to the following one:

<Style TargetType="telerik:HighlightTextBlock">
	<Setter Property="HighlightBrush" Value="Lime"/>
	<Setter Property="FontWeight" Value="Bold"/>
	<Setter Property="FontStyle" Value="Italic"/>
</Style>

More information on customizing the HighlightTextBlock can also be found in the following two articles - Styling Search Panel and Coloring Only Text Background.
Please, try out these and let me know if they were of help.

Best Regards,
Vicky
Progress Telerik

0
Heiko
Top achievements
Rank 1
Iron
Veteran
answered on 16 Jul 2020, 02:51 PM

Hello Vicky,

thanks for the reply. Your solution formats the whole text in all cells in bold. What I would like is if I search for "find" I get a result like "Find me". Maybe a new property named "HighlightFontWeight" would be a good idea. I will make a suggestion in your feedback portal.

Best regards
Heiko

0
Vicky
Telerik team
answered on 17 Jul 2020, 07:45 AM

Hi Heiko,

Yes, you are right - the current implementation applies all properties set to the HighlightTextBlock to the whole text (except for the HighlightBrush).
A suggested action in such case is exactly to log an item in the feedback portal, so feel free to do it.

If there is anything else I could assist you with, do not hesitate to contact me.

Regards,
Vicky
Progress Telerik

Tags
GridView
Asked by
Heiko
Top achievements
Rank 1
Iron
Veteran
Answers by
Vicky
Telerik team
Heiko
Top achievements
Rank 1
Iron
Veteran
Share this question
or