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

Contains filter doesn't match a trailing 0

3 Answers 38 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Kevin
Top achievements
Rank 1
Kevin asked on 21 Jan 2013, 08:46 PM
I am trying to match a four digit number with a radautocompletebox using the contains filter. It works great except for when the last digit is a 0, in which case it doesn't filter by that digit (The same thing happens with a 9). For example, if I type 7260, the first match I get is for 7264 even though there is an entry of 7260 in the list. Any ideas?

3 Answers, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 1
answered on 21 Jan 2013, 09:00 PM
After doing some more testing, I found that it never matches by a 9 or 0 unless there are other digits (besides a 9 or 0) after the first occurrence (e.g. 990 does not match anything). The only way I can get it to match is to type a space then delete the space. After you do that, the 9 or 0 is highlighted as a match and the list is properly filtered. Any help would be greatly appreciated.
0
Cat Cheshire
Top achievements
Rank 1
answered on 25 Jan 2013, 09:22 AM
How do you populate the autocomplete with data?
Can you paste here some working code?
0
Kevin
Top achievements
Rank 1
answered on 25 Jan 2013, 02:16 PM
So it turns out that the problem is with a radcombobox, not a radautocompletebox.
The code is below. The GetNumberName field is a property that I added to the
datacontext to combine the department number and name.

<telerik:RadComboBox CssClass="departmentDropDown" ID="department" DataTextField="GetNumberName" DataValueField="Id" runat="server" OnSelectedIndexChanged="DepartmentSelectedIndexChanged" AutoPostBack="True" MarkFirstMatch="True" Filter="Contains" Width="304px" CausesValidation="False" DataSourceID="DeptData" AllowCustomText="false" OnDataBound="AddRow" Skin="Default"/>
<asp:LinqDataSource ID="DeptData" runat="server" ContextTypeName="Meriter.UserAccessRequest.Lib.UserAccessRequestDataClassesDataContext" EntityTypeName="" Select="new (Id, GetNumberName)" TableName="DepartmentNumberNames" OrderBy="DepartmentName">
</asp:LinqDataSource>

Thanks for any help,
Kevin
Tags
AutoCompleteBox
Asked by
Kevin
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 1
Cat Cheshire
Top achievements
Rank 1
Share this question
or