Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions xamarin-android/SfAutoComplete/highlighting-matched-text.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
---
layout : post
title : MatchHighlighting in Syncfusion SfAutoComplete control for Xamarin.Android
description : Learn how to highlight the matched text in SfAutoComplete
title: MatchHighlighting text in Syncfusion SfAutoComplete control.
description: Learn on how to highlight the matched text in SfAutoComplete for Xamarin.Android and also understood the highlight the matching characters in suggestion list
platform : Xamarin.Android
control : SfAutoComplete
documentation : ug
---

{% banner %}

{:.gradient_m}

{% col_2_equal %}

# Highlighting matched text

Highlight matching characters in a suggestion list to pick an item with more clarity. There are two ways to highlight the matching text:
Expand All @@ -20,7 +26,7 @@ The text highlight can be indicated with various customizing styles by enabling

* HighlightedTextColor - sets the color of the highlighted text for differentiating the highlighted characters.

* HighlightedTextFontAttributes - sets the FontAttributes of the highlighted text.
* HighlightedTextFontTypeFace - sets the FontAttributes of the highlighted text.

## First Occurrence

Expand All @@ -30,19 +36,19 @@ It highlights the first position of the matching characters in the suggestion li

{% highlight C# %}

countryAutoComplete.SuggestionMode=SuggestionMode.StartsWith;
countryAutoComplete.TextHighlightMode=OccurrenceMode.FirstOccurrence;
countryNameAutoComplete.HighlightedTextColor = Color.Red;
countryNameAutoComplete.HighlightedTextFontAttributes = HighlightedTextFontAttributes.Bold;
countryAutoComplete.SuggestionMode = SuggestionMode.StartsWith;
countryAutoComplete.TextHighlightMode = OccurrenceMode.FirstOccurrence;
countryAutoComplete.HighlightedTextColor = Color.Blue;
countryAutoComplete.HighlightedTextFontTypeFace = TypefaceStyle.Bold;

{% endhighlight %}

{% endtabs %}

N> The default Color of HighlightedTextColor is Red.
The default FontAttribute of HighlightedTextFontAttributes is None.
The default FontAttribute of HighlightedTextFontTypeFace is None.

![](images/FirstOccurrence.png)
![First Occurrence AutoComplete Image](images/FirstOccurrence.png)

## Multiple Occurrence

Expand All @@ -52,16 +58,16 @@ It highlights the matching character that are present everywhere in the suggesti

{% highlight C# %}

countryAutoComplete.SuggestionMode=SuggestionMode.Contains;
countryAutoComplete.TextHighlightMode=OccurrenceMode.MultipleOccurrence;
countryAutoComplete.SuggestionMode = SuggestionMode.Contains;
countryAutoComplete.TextHighlightMode = OccurrenceMode.MultipleOccurrence;
countryNameAutoComplete.HighlightedTextColor = Color.Red;
countryNameAutoComplete.HighlightedTextFontAttributes = HighlightedTextFontAttributes.Bold;
countryNameAutoComplete.HighlightedTextFontTypeFace = TypefaceStyle.Bold;

{% endhighlight %}

{% endtabs %}

![](images/MultipleOccurrence.png)
![Multiple Occurrence AutoComplete Image](images/MultipleOccurrence.png)