locked
Ajax ListSearchExtender stop typing and searching when pressing "Space" key RRS feed

  • Question

  • User-786564416 posted

    I have DropDownList and its ListSearcExtender as following:

    <asp:DropDownList ID="BelongingAdminUnitDDL" runat="server" AppendDataBoundItems="true" DataSourceID="SDS1" DataTextField="Name" DataValueField="Indx" onMouseOut="this.className='Buttonout'" onMouseOver="this.className='Buttonhover'" style="font-family: 'sakkal Majalla'; font-size: 24px; border-style:solid; border-width:1px;border-color:Black;text-align:right;
                            -moz-border-radius: 15px;-webkit-border-radius: 15px;border-radius: 15px;" Width="535px">
                            </asp:DropDownList>
                            <asp:ListSearchExtender ID="BelongingAdminUnitDDL_ListSearchExtender" runat="server" Enabled="True" TargetControlID="BelongingAdminUnitDDL" PromptPosition="Bottom" PromptText="اختر الوحدة الإدارية" QueryPattern="Contains" PromptCssClass="ListSearchingStyle"  IsSorted="True">
                            </asp:ListSearchExtender>

    Its Arabic Editing. when I start typing, it works fine by showing the matched items, however, once I press the space key, the typing stopped and the whole DDL items are shown. This means that If I have two items containing two segments: NEW ENGLAND, NEW YORK, when I type NEW it shows me NEW ENGLAND but once I press space to type the remaining letters, it stop typing and shows me the whole DDL.

    SO, how to deal with it so I can write the full searching word even if it contains spaces.

    Wednesday, October 3, 2018 11:25 PM

All replies

  • User61956409 posted

    Hi alihusain_77,

    This means that If I have two items containing two segments: NEW ENGLAND, NEW YORK, when I type NEW it shows me NEW ENGLAND but once I press space to type the remaining letters, it stop typing and shows me the whole DDL.

    I do a test with the following code snippet using AjaxControlToolkit v18.1.0, the code work as expected on my side. If possible, you can upgrade your AjaxControlToolkit or check if it works in another browser.

    <h3 style="color: Red">Choose City</h3>
     
    <br />
    <asp:DropDownList ID="DropDownList1" runat="server">
        <asp:ListItem>---select---</asp:ListItem>
        <asp:ListItem>NEW ENGLAND</asp:ListItem>
        <asp:ListItem>NEW YORK</asp:ListItem>
        <asp:ListItem>Item 111</asp:ListItem>
        <asp:ListItem>Item 222</asp:ListItem>
        <asp:ListItem>Item 333</asp:ListItem>
    </asp:DropDownList>
    
    <ajaxToolkit:ListSearchExtender ID="BelongingAdminUnitDDL_ListSearchExtender" runat="server" Enabled="True" TargetControlID="DropDownList1" PromptPosition="Top" PromptText="search city" QueryPattern="Contains" PromptCssClass="ListSearchingStyle" IsSorted="True">
    </ajaxToolkit:ListSearchExtender>

    Test Result:

    With Regards,

    Fei Han

    Thursday, October 4, 2018 9:45 AM