What’s New in 2018 Volume 1: Autocomplete Xamarin | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (174).NET Core  (29).NET MAUI  (207)Angular  (109)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (40)Black Friday Deal  (1)Blazor  (215)BoldSign  (14)DocIO  (24)Essential JS 2  (107)Essential Studio  (200)File Formats  (66)Flutter  (133)JavaScript  (221)Microsoft  (118)PDF  (81)Python  (1)React  (100)Streamlit  (1)Succinctly series  (131)Syncfusion  (914)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (51)Windows Forms  (61)WinUI  (68)WPF  (159)Xamarin  (161)XlsIO  (36)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (147)Chart  (131)Cloud  (15)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (63)Development  (628)Doc  (8)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (40)Extensions  (22)File Manager  (7)Gantt  (18)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (507)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (43)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (12)Scheduler  (52)Security  (3)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (31)Solution Services  (4)Spreadsheet  (11)SQL  (10)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (387)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (19)Web  (592)What's new  (332)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)

What’s New in 2018 Volume 1: Autocomplete Xamarin

Syncfusion is excited to announce several important enhancements in the autocomplete component for Xamarin.Forms for the release of Essential Studio 2018 Volume 1! Here are the highlights of the added features.

Multiselection

The input field has been improved to address scenarios such as email address bars. You can select multiple items with token representation, or simply divide them with a delimiter. Customizable token representation allows users to remove an item with a close button. Users can divide the selected items with characters they choose, such as $ for dollar representation, or the traditional comma.

How to configure multiselection

Tokens
XAML

C#

this.autoComplete.MultiSelectMode = MultiSelectMode.Token;
this.autoComplete.TokenWrapMode = TokenWrapMode.Wrap;
Delimiter
XAML

C#

this.autoComplete.MultiSelectMode = MultiSelectMode.Delimiter;
this.autoComplete.TokenWrapMode = TokenWrapMode.Wrap;

Matching text highlight

The autocomplete control can highlight the matching text in each filtered item. This option helps users detect how the items are filtered and provides more clarity to picking an item.

How to configure matching text highlight

For a single occurrence

XAML

C#

this.autoComplete.TextHighlightMode = TextHighlightMode.FirstOccurance;
this.autoComplete.HighlightTextColor = Color.Red;
For multiple occurrences in a “Contains” search

 

XAML

C#

this.autoComplete.TextHighlightMode = extHighlightMode.MultipleOccurance;
this.autoComplete.HighlightTextColor = Color.Red;

Diacritic sense

The autocomplete control does not stick with the keyboard. Therefore, you can populate items using languages that feature letters containing diacritic marks, and search for them with English characters from an en-US keyboard.

How to configure diacritic sense

XAML
C#
this.autoComplete.IgnoreDiacritic = true;

Custom search

The autocomplete control has a provision to apply your search logic that suggests the items based on your search. This support will help you apply your own typo toleration functionality to the control.

How to configure custom search

XAML
C#
this.autoComplete.AutoCompleteMode = AutoCompleteMode.Custom;

C#

this.autoComplete.Filter = CustomSearch;
  public bool CustomSearch(object inputText, object currentItem)
      {
          if(currentItem.ToString().Contains("$"))
              return true; // It will filter the current item         
          return false; // Ignores the current items     
  }

Improved loading and searching performance

Now the autocomplete component can load and search through 100,000 items in less than a second.

Load more

If the filtered items are numerous, there is no need to worry about populating all of them. Instead, they can be limited by using an option in the control, and more can be loaded if needed. This dynamic loading option results in increased performance.

How to configure load more

XAML
C#
this.autoComplete.MaximumSuggestion = 10;

Header and footer

Users can add header and footer views for the drop-down, so users can provide out-of-box options such as a button to search the unavailable content in another way, or add a new item at the application level.

How to add header and footer

XAML
<autocomplete:SfAutoComplete>
	<autocomplete:SfAutoComplete.DropDownHeaderView>
		<Button Text="Search for"/> <!—Perform require searching logic on its click event -->
	</autocomplete:SfAutoComplete.DropDownHeaderView>
	<autocomplete:SfAutoComplete.DropDownFooterView>
	<Button Text="Add New Contact"/> <!—Perform adding new contact logic on its click event -->
	</autocomplete:SfAutoComplete.DropDownFooterView>
</autocomplete:SfAutoComplete>

C#

autoComplete.DropDownHeaderView = new Button() { Text = "Search for"};
autoComplete.DropDownFooterView = new Button() { Text = "Add New Contact"};

Avoid pop-up

APIs are available to avoid the pop-up and retrieve filtered suggestion items to help you arrange your design for any list or items control. Once the pop-up is avoided, the FilteredCollection property of the autocomplete component can filter the updated suggestion items that can then be bound with any items control.

How to avoid popup

XAML
C#
this.autoComplete.DropDownPlacement = DropDownPlacement.None;

 

How to bind suggestion items to an items control

C#
ListView listView = new ListView();

listView.ItemsSource = this.autoComplete.FilteredCollection //Add this line in when text changes or whenever its required

Conclusion

Along with the mentioned major features, we have considered customer feedback and added several minor features, exposed all the customizable elements, and improved the stability of the autocomplete control. We expect to roll out the Volume 1 release by the middle of February. Leave us your valuable feedback or questions in the comments section below.

Tags:

Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed