AutoCompleteBox AsyncPostback Problem

4 posts, 0 answers
  1. Eric
    Eric avatar
    3 posts
    Member since:
    May 2011

    Posted 02 Sep 2013 Link to this post

    Hello,

    I have a problem with RadAutoCompleteBox.EntryAdded server event. 
    I use a dropdownlist to bind RadAutoCompleteBox, and set RadAjaxManager then it can be async, but it's not firing,
    when I remove  RadAjaxManager's setting, back to Postback mode, it's work fine.
    please help me to resolve this issue, thanks!!

    aspx:
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdatePanelsRenderMode="Inline">
             <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="ddlRoleId">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="ddlRoleId" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
                        <telerik:AjaxUpdatedControl ControlID="racEmp"></telerik:AjaxUpdatedControl>          
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" skin="Vista"/>
     
     
    <asp:DropDownList ID="ddlRoleId" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlRoleId_SelectedIndexChanged"></asp:DropDownList>  
        
           
    <telerik:RadAutoCompleteBox ID="racEmp" runat="server" Width="700" DropDownWidth="300" Delimiter=";" InputType="Token" DropDownPosition="Automatic" Skin="Windows7">
    </telerik:RadAutoCompleteBox>

    aspx.cs:
    protected void ddlRoleId_SelectedIndexChanged(object sender, EventArgs e)
        {
            RadAutoCompleteBoxEntryAdd();
        }
     
        #region RadAutoCompleteBox
        private void RadAutoCompleteBoxEntryAdd()
        {
            racEmp.Entries.Clear();
             
            String strType = ddlRoleId.Text;
            //String strType = "ITAdmin";
            Roles r = new Roles();
            Employee emp = new Employee();
            DataTable dt = r.getRoleEmpList(strType);
            //RadAjaxManager1.Alert(dt.Rows.Count.ToString());
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    String strEmpId = dt.Rows[i]["EmpId"].ToString();
                    DataTable dtEmp = emp.getEmpList(strEmpId);
                    String strEmpName = dtEmp.Rows[0]["EmpName"].ToString();
                    racEmp.Entries.Add(new AutoCompleteBoxEntry(strEmpName, strEmpId));
                     
                    //RadAjaxManager1.Alert(entry.Text);
                }
            }
     
            RadAutoCompleteBoxDataBind(racEmp, emp.getEmpList(), "ADAccount", "EmpName");
        }
        #endregion
     
     public static void RadAutoCompleteBoxDataBind(RadAutoCompleteBox rac, DataTable dtsource, String value, String text)
            {
                rac.DataSource = dtsource;
                rac.DataValueField = value;
                rac.DataTextField = text;
                //rac.DataBind();
     
                 
            }
    P.S My Ver 2012.2.912.35

    Best regards

  2. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 05 Sep 2013 Link to this post

    Hello Eric,

    Would you elaborate a bit more on your scenario. As far as I had understood, the EntryAdded server-side event is fired in a non-ajax scenario, when you add programatically entries in the RadAucomCompleteBox? I am afraid, that this event could not be fired, if you add entries programatically. I would like to ask you to record a video, demonstrating the issue at your end, so we could get a clearer picture on the matter.

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Eric
    Eric avatar
    3 posts
    Member since:
    May 2011

    Posted 05 Sep 2013 Link to this post

    Hello Nencho,

    i called RadAutoCompleteBoxEntryAdd() when  dropdown selectedIndexChanged and PageLoad,
    PageLoad works fine, only dropdown  selectedIndexChanged  not firing (on async mode)(postback works fine too).

    thank you for helping!

    Regards




  5. Nencho
    Admin
    Nencho avatar
    1457 posts

    Posted 10 Sep 2013 Link to this post

    Hello Eric,

    I had prepared a sample project for you, demonstrating the behavior at my end. Would you give it a try at your end? If the issue still persist, please let me know how to modify the provided sample, so we could replicate the issue locally. Please find the sample attached.

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