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

Ignore accent in autocomplete ComboBox

3 Answers 294 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Guillaume
Top achievements
Rank 1
Guillaume asked on 21 Feb 2014, 03:36 PM
Hi, 

I am trying to find a way to ignore the accents entered in the combobox with the autocomplete function.

If someone enter "René" as text, the function I used to populate the combobox won't use the accent and the actual filter used will be "Rene".
But as a result that none of my result contains an accent, nothing is displayed in the comboxbox, except the number of results  found.

Is there any way for the combobox to not use the accent in the filter ?

Thanks !

3 Answers, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 26 Feb 2014, 01:27 PM
Hello Guillaume,

The RadComboBox does not support such functionality by design. However, I would suggest you to implement a LoadOnDemand functionality and the desired functionality, by handling the event handler (ItemsRequested) and getting the typed characters and then returning the desired results.

Regards,
Nencho
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
0
Arcelia
Top achievements
Rank 1
answered on 15 Jul 2015, 12:55 AM

Hello Nencho,

 

Can you make a example please.?

 

Regards.​

0
Nencho
Telerik team
answered on 17 Jul 2015, 10:42 AM
Hello Arcella,

You can simply replace the é character with e in the filter string, which is accessible in the ItemsRequested event handler. Please consider the below implementation:

protected void RadComboBox1_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
   {
       var searchString = e.Text;
       searchString = searchString.Replace("é", "e");
 
       List<RadComboBoxItem> list = new List<RadComboBoxItem>();
 
       for (int i = 0; i < 20; i++)
       {
           list.Add(new RadComboBoxItem("Cent" + i.ToString()));
       }
 
       var filteredFileSet = list.Where(item => item.Text.Contains(searchString));
 
       RadComboBox1.DataSource = filteredFileSet;
       RadComboBox1.DataTextField = "Text";
 
       RadComboBox1.DataBind();
   }



Regards,
Nencho
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ComboBox
Asked by
Guillaume
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Arcelia
Top achievements
Rank 1
Share this question
or