Contains filter doesn't match a trailing 0

4 posts, 0 answers
  1. Kevin
    Kevin avatar
    3 posts
    Member since:
    Jan 2013

    Posted 21 Jan 2013 Link to this post

    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?
  2. Kevin
    Kevin avatar
    3 posts
    Member since:
    Jan 2013

    Posted 21 Jan 2013 Link to this post

    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.
  3. Cat Cheshire
    Cat Cheshire avatar
    128 posts
    Member since:
    Jun 2010

    Posted 25 Jan 2013 Link to this post

    How do you populate the autocomplete with data?
    Can you paste here some working code?
  4. Kevin
    Kevin avatar
    3 posts
    Member since:
    Jan 2013

    Posted 25 Jan 2013 Link to this post

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