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

How to force RadSearchBox to ignore case?

6 Answers 131 Views
SearchBox
This is a migrated thread and some comments may be shown as answers.
Allin
Top achievements
Rank 1
Allin asked on 06 Dec 2013, 02:58 PM
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

6 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 09 Dec 2013, 11:00 AM
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.
0
Allin
Top achievements
Rank 1
answered on 09 Dec 2013, 02:14 PM
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


0
Nencho
Telerik team
answered on 10 Dec 2013, 12:32 PM
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.
0
Allin
Top achievements
Rank 1
answered on 10 Dec 2013, 01:30 PM
Thank you Nencho. I will try it soon...
0
Allin
Top achievements
Rank 1
answered on 10 Apr 2014, 06:23 PM
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.

0
Plamen
Telerik team
answered on 15 Apr 2014, 05:49 AM
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.

 
Tags
SearchBox
Asked by
Allin
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Allin
Top achievements
Rank 1
Nencho
Telerik team
Plamen
Telerik team
Share this question
or