Anyname Donotcare
Anyname Donotcare

Reputation: 11393

How to filter the radcombobox with unadjacent words?

If i use the radcombobox :

as the following :

<telerik:RadComboBox ID="ddl_emp1" runat="server" AutoPostBack="True" CausesValidation="false"
CollapseDelay="0" Culture="ar-EG" ExpandDelay="0" Filter="Contains"  ItemsPerRequest="100"
MarkFirstMatch="true" Skin="Outlook" Width="200px" EnableAutomaticLoadOnDemand="True"
EmptyMessage="-Type Employee Name -" ValidationGroup="2" ShowMoreResultsBox="True"                                           OnSelectedIndexChanged="ddl_emp1_SelectedIndexChanged">
</telerik:RadComboBox>

if the items in the combo box consists of multi parts ,say for example :

Ran jack Rony

i wanna to get this item ,if i type Ran Rony ,i get no result . i set the Filter property to "Contains" instead "StartWith" but it doesn't fix this issue

Upvotes: 0

Views: 844

Answers (1)

RajN
RajN

Reputation: 47

Assuming you are doing that search in SQL, and showing the result in ComboBox (could be RadCombobox).

You should do replace on space, in the sql query; and then do a like on that field.

Example:

You ask for: Ran jack Rony

Your SQL Query should do:

SET @filter = 'Ran jack Rony';
SET @filter = REPLACE(@filter, ' ', '%');
SELECT * FROM TableName WHERE FieldName LIKE @filter;

Upvotes: 1

Related Questions