How to force RadSearchBox to ignore case?

7 posts, 0 answers
  1. Allin
    Allin avatar
    33 posts
    Member since:
    Jun 2012

    Posted 06 Dec 2013 Link to this post

    Hi,

    I use RadSearchBox with a LinqDataSource and when I write text in uppercase, it can't find the data in lowercase.

    I don't find any setting in radSearchBox to resolve this issue.

    ty

  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 09 Dec 2013 Link to this post

    Hi Allin,

    Please have a look into the following code snippet which works fine at my end.

    ASPX:
    <telerik:RadSearchBox runat="server" ID="RadSearchBox2" EmptyMessage="Linq" DataSourceID="LinqDataSource1"
        DataValueField="ContactName" DataTextField="City" Filter="StartsWith">
    </telerik:RadSearchBox>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="DataClassesDataContext"
        OrderBy="ContactName" Select="new (ContactTitle, ContactName, City)" TableName="Customers">
    </asp:LinqDataSource>

    Please provide your code if it doesn't help.
    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Allin
    Allin avatar
    33 posts
    Member since:
    Jun 2012

    Posted 09 Dec 2013 Link to this post

    Hi Princy,

    I use Filter="Contains".

    If you write New in radSearchBox and the city in database is new york, the radSearchBox find nothing. That's my issue, i want the radSearchBox find all New, new, NeW, nEw in the result of the linq query.

    radSearchBox settings :
    <telerik:RadSearchBox ID="rsbFind" runat="server" Width="330px" EnableAutoComplete="true" ShowSearchButton="false" EmptyMessage=""
                                            DataKeyNames="ID"
                                            DataValueField="ID"
                                            DataSourceID="rbsFindLinqDataSource"  
                                            DataTextField="QuickSearchField"
                                            Filter="Contains"
                                            HighlightFirstMatch="True">
                                            <DropDownSettings Height="150px">
                                            </DropDownSettings>
                                        </telerik:RadSearchBox>

    QuickSearchField is expression containing the data.

    EnableAutoComplete set to True to showing the result during writing word to search, this is this list who find nothing.

    I can't find any settings or event to bypass this issue with RadSearchBox and i need to make this field case insensitve, because searches are unsucessful.

    ty


  5. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 10 Dec 2013 Link to this post

    Hello Allin,

    I would suggest you to use our recently implemented IsCaseSensitive property of the RadSearchBox. You could download our latest internal build where it is included.

    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 RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  6. Allin
    Allin avatar
    33 posts
    Member since:
    Jun 2012

    Posted 10 Dec 2013 Link to this post

    Thank you Nencho. I will try it soon...
  7. Allin
    Allin avatar
    33 posts
    Member since:
    Jun 2012

    Posted 10 Apr 2014 in reply to Allin Link to this post

    Hi,

    IsCaseSensitive = False works fine, except if i use the RadSearchBox with LinqDataSource and i fill the data into the selecting event with e.Result = controller.GetAll(). In this case, the radSearchBox is always case sensitive.

  8. Plamen
    Admin
    Plamen avatar
    2734 posts

    Posted 15 Apr 2014 Link to this post

    Hi Allin,

    In case with LinqDataSource case sensitivity depends on the database collation itself and can not be manipulated with the data command. You can find more information regarding the issue in the following forum thread where the issue have been discussed:
    http://www.experts-exchange.com/Programming/Languages/.NET/Q_26259775.html

    Hope this information will explain the issue.

    Regards,
    Plamen
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017