We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Highlighting text programmatically

Hi,
suppose I want to search all the occurrences of a word or literal in source code text displayed in the EditControl, and say I want to highlight all the occurrences e.g. in yellow. Is there a way to accomplish this?

Thanks in advance,
Alessandro

3 Replies

PB Priyanga Balasubramaniam Syncfusion Team November 23, 2015 11:32 AM UTC

Hi Alessandro,

Thank you for using Syncfusion products.

We have analyzed your requirement for "Highlighting text while search all occurrences in the EditControl". The highlight feature is not available in our product, but we can search the text using “Find and Replace DialogWindow”. We have also prepared a sample. In this sample, while searching all the occurrences of word or literal in the EditControl it displays all occurrences with line number in the "Find Symbol Results" box. You can refer all occurrences of text or literal from here.

Please download the sample from the below location.

Sample: EditControlSample

Regards,
Priyanga B


AD Alessandro Del Sole November 23, 2015 05:24 PM UTC

First, thanks for your reply and for your time in preparing an example. However, I think the example is incomplete as I just see the text editor populated with the SQL code in the code-behind file but no other features are available.

Thanks again.


PB Priyanga Balasubramaniam Syncfusion Team November 24, 2015 10:08 AM UTC

Hi Alessandro,

We have attached a sample. In this sample you can view "Find and Replace DialogWindow" by choosing "Find and Replace" MenuItem in Edit Menu. Also you can view "Find and Replace DialogWindow" by Pressing Ctrl + F.

Choose "Find Symbol" option in top most combobox in "Find and Replace DialogWindow". Type the text or literal in "Find what" editable combobox and click the "Find All" button. Now all occurrences of the text or literal displayed in the "Find Symbol Results" box with line number.

Please download the sample from the below location.

Sample: EditControlSample

Regards,
Priyanga B

Loader.
Up arrow icon