How to make AJAX RadAutoCompleteBox search case insensitive?

2 posts, 0 answers
  1. Quintin
    Quintin avatar
    1 posts
    Member since:
    Oct 2013

    Posted 23 Jan 2014 Link to this post

    Hey Guys,

    The problem I am having is that the filtering functionality of the AutoCompleteBox is case sensitive.

    I have names stored in the database with an uppercase first letter, so if a user enters a lower case letter into the autocompletebox, it does not display any results.

    I have searched for properties within the control itself to work around this, but there seems to be none.  Is there a way to handle the filtering method myself in the server code, or even the client?

    I'm implementing a RadAutoCompleteBox to search through a list of items bound to the control using a LinqDataSource.

    In the LinqDataSource, I am use the onselecting event to fetch the data.

    protected void LinqDataSourceForAutoComplete_OnSelecting(object sender, LinqDataSourceSelectEventArgs e)
                using (DataClassesDataContext dc = new DataClassesDataContext())
                    var membersUsers = (from ue in dc.UserEntities
                        join boe in dc.BusinessOwnerEntities on ue.ID equals boe.UserEntity.ID into j1
                        from j2 in j1.DefaultIfEmpty()
                        where j2 != null
                        select new
                            ID = ue.ID,
                            Description =
                                string.Format("{0}, {1}", ue.Surname,
                                    ue.PreferredName != null ? ue.PreferredName : ue.FirstName)
                    e.Result = membersUsers;

    and here is the markup for the RadAutoCompleteBox

    <telerik:RadAutoCompleteBox runat="server" ID="RadAutoCompleteBox1

    Any help on how I could get around this would be greatly appreciated!
  2. Kate
    Kate avatar
    1898 posts

    Posted 27 Jan 2014 Link to this post

    Hello Quintin,

    I tested the scenario that you describe (with this demo) and I could get the entry whose text I typed in the input of the control(check the attached image).

    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.
Back to Top