AutoCompleteBox problem with Single Selection Mode and Text Input Type

11 posts, 0 answers
  1. Jason
    Jason avatar
    22 posts
    Member since:
    Sep 2007

    Posted 03 Oct 2013 Link to this post

    Hi, I am using the AutoCompleteBox with the following configuration:

    <telerik:RadAutoCompleteBox runat="server" ID="Recipient_RadAutoCompleteBox" AllowCustomEntry="true" TextSettings-SelectionMode="Single" Width="200px"  DataSourceID="Recipient_SqlDataSource"  DataTextField="Name" InputType="Text">
    </telerik:RadAutoCompleteBox >

    Everything works fine if the user types an entry that is not in the list, or if the user selects an item from the list and then hits the "Tab" or "Enter" key. The problem I'm having occurs when the user arrows down the list to highlight an entry or types in the same text as an existing entry, and then uses the mouse to put the focus on another field on the page. When that happens, the text shows in the AutoCompleteBox correctly, but on the server side there are no entries added to the Control and the .Text property is also empty. Please help.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 04 Oct 2013 Link to this post

    Hi Jason,

    Please have a look into the following code snippet that I tried to access the selected Item of RadAutoCompleteBox on RadButton OnClick event. I am not able to replicate the issue for me it is working fine.

    ASPX:
    <telerik:RadAutoCompleteBox runat="server" ID="Recipient_RadAutoCompleteBox" AllowCustomEntry="true"
        TextSettings-SelectionMode="Single" Width="200px" DataSourceID="SqlDataSource1"
        DataTextField="ContactName" InputType="Text">
    </telerik:RadAutoCompleteBox>
    <telerik:RadButton ID="RadButton1" runat="server" AutoPostBack="true" Text="CheckValue"
        OnClick="RadButton1_Click">
    </telerik:RadButton>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
        SelectCommand="SELECT [ContactName] FROM [Customers]">
    </asp:SqlDataSource>

    C#:
    protected void RadButton1_Click(object sender, EventArgs e)
    {
        string value = Recipient_RadAutoCompleteBox.Text;
    }

    Please provide your full code if it doesn't help you.
    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jason
    Jason avatar
    22 posts
    Member since:
    Sep 2007

    Posted 04 Oct 2013 Link to this post

    Nope still doesn't work for me. I noticed that it does work in IE but not in Chrome. For both browsers though, it does not work if I type the exact text of an existing entry and then mouse out of the field without hitting tab or enter. 
  5. Jason
    Jason avatar
    22 posts
    Member since:
    Sep 2007

    Posted 07 Oct 2013 Link to this post

    Here is a test page that I setup to demonstrate the issue. Please test it multiple times in different browsers because it does work correctly sometimes:

    ASPX:
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="test.aspx.vb" Inherits="Deliverables_test" %>
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
     
    <!DOCTYPE html>
     
    <head runat="server">
        <title>test</title>
    </head>
    <body>
        <form id="form1" runat="server">
        <div>
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server" ></telerik:RadScriptManager>
     
            <telerik:RadAutoCompleteBox runat="server" ID="test_RadAutoCompleteBox" AllowCustomEntry="true" TextSettings-SelectionMode="Single" Width="200px" InputType="Text"
                 DataSourceID="test_SqlDataSource"  DataTextField="Name">           
            </telerik:RadAutoCompleteBox >
     
             <asp:SqlDataSource ID="test_SqlDataSource" runat="server"
                    SelectCommand="Select Distinct C.ContactID, (C.FirstName + ' ' + C.LastName) as Name
                            from Contact C"
                    ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"
                    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" />
     
            <asp:Button ID="Submit_Button" runat="server" Text="Test" />
            <br /><br />
            Selected: <asp:Label ID="result_Label" runat="server"></asp:Label>
     
     
     
        </div>
        </form>
    </body>
    </html>


    VB.NET:
    Partial Class Deliverables_test
        Inherits System.Web.UI.Page
     
        Protected Sub Submit_Button_Click(sender As Object, e As EventArgs) Handles Submit_Button.Click
            result_Label.Text = test_RadAutoCompleteBox.Text
        End Sub
    End Class
  6. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 08 Oct 2013 Link to this post

    Hello Jason,

    I tried to replicate the described behavior, but to no avail. I had prepared a sample project, base on the provided implementation. As suggested, I had tested several times the behavior, under different browser, but I am afraid that the result was the same - not replicated. Would you also give it a try at your end and let is know if I had missed something. It would be helpful, if you could record a video(using Jing), demonstrating the issue.

    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.
  7. Jason
    Jason avatar
    22 posts
    Member since:
    Sep 2007

    Posted 08 Oct 2013 Link to this post

    I downloaded your solution and it does the same thing. I even tested it on other machines to make sure it wasn't my computer. I recorded some videos to show you what its doing. Do I need to create a support ticket to upload them?
  8. Jason
    Jason avatar
    22 posts
    Member since:
    Sep 2007

    Posted 08 Oct 2013 Link to this post

    I uploaded the videos to my screencast account. This one shows me typing in the text of an entry and then mousing out of the field:

    http://www.screencast.com/t/8wn0bQtRcn


    And this one shows me using the keyboard to highlight and entry and then mousing out of the field:

    http://www.screencast.com/t/42BWh3nd5Cp
  9. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 11 Oct 2013 Link to this post

    Hello Jason,

    The provided video was helpful. After further attempt of replication of the issue - I was able to do so. I have already forwarded it to our developer team for further investigation. Thank you for pointing that out. Your Telerik Points are updated.

    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.
  10. Mari
    Mari avatar
    2 posts
    Member since:
    Oct 2013

    Posted 23 Oct 2013 Link to this post

    Hi,

    I am also running into the same problem, using a RadAutoCompleteBox with LoadOnDemand, loading data from a web service.  On selecting an entry a postback is triggered but the entry list is empty.  For me pressing enter and tab after selection don't make any difference, the list is still empty.  What is strange, is that if I add a javascript function to handle the OnClientEntryAdded event, and put an alert pop-up in that function, then the entry list is filled. 

    I'll be interested to hear if  you come up with a solution.

    Thanks
     

  11. Bozhidar
    Admin
    Bozhidar avatar
    1103 posts

    Posted 28 Oct 2013 Link to this post

    Hi,

    The original issue that Jason explained about mousing out of the AutoCompleteBox and the entries being empty has now been resolved, and the working version will be available in our next internal build, as well as the upcoming ServicePack.

    As for your issue Mari, it seems to be a different one, so I suggest you open a support ticket and attach a sample project that we can inspect in order to troubleshoot it.

    Regards,
    Bozhidar
    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.
  12. Mari
    Mari avatar
    2 posts
    Member since:
    Oct 2013

    Posted 01 Nov 2013 Link to this post

    Hi,

    In the process of setting up the example project I discovered what the problem was.  We were using a clientside script to trigger postback, which was called in the OnClientEntryAdded handler.  This was a holdover from when we used the RadComboBox and needed to trigger postback only under certain circumstances.  This is no longer the case so now I have simply registered a serverside function for OnEntryAdded, and the entries are passed through fine. 

    Thanks
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017