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

AutoCompleteBox AsyncPostback Problem

3 Answers 45 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 02 Sep 2013, 10:23 AM
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

3 Answers, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 05 Sep 2013, 08:29 AM
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.
0
Eric
Top achievements
Rank 1
answered on 05 Sep 2013, 09:52 AM
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




0
Nencho
Telerik team
answered on 10 Sep 2013, 07:27 AM
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.
Tags
AutoCompleteBox
Asked by
Eric
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Eric
Top achievements
Rank 1
Share this question
or