RadAjaxManager Update Controls

2 posts, 0 answers
  1. Muhammad
    Muhammad avatar
    87 posts
    Member since:
    Oct 2012

    Posted 25 Jun 2013 Link to this post


    I am using RadAjaxManager to update dropdown and tooltip but the problem is that when I update the dropdown it halts and I can not open the dropdown. Any help would be greatly appreciated.

    <telerik:RadComboBox ID="rcbTemplate" AutoPostBack="true" Height="200px" runat="server">
                            <asp:LinkButton ID="btnAddTemplates" Text="Add/Edit Template" Visible="false" runat="server">                           
                            <telerik:RadAjaxManager ID="_RadAjaxManager" OnAjaxRequest="rjm_AjaxRequest" runat="server">                           
                                    <telerik:AjaxSetting AjaxControlID="btnSave">
                                            <telerik:AjaxUpdatedControl ControlID="rttm"></telerik:AjaxUpdatedControl>
                                            <telerik:AjaxUpdatedControl ControlID="rcbTemplate"></telerik:AjaxUpdatedControl>
                                            <telerik:AjaxUpdatedControl ControlID="rgInvoiceTemplateDetail"></telerik:AjaxUpdatedControl>
                            <telerik:RadToolTipManager ID="rttm" runat="server" Position="TopRight" Animation="Fade"
                                ShowEvent="OnClick" HideEvent="ManualClose" OnAjaxUpdate="OnAjaxUpdate" RelativeTo="Element"
                                Width="250px" Height="250px" RenderInPageRoot="true">
                                    <telerik:ToolTipTargetControl TargetControlID="btnAddTemplates" />
                            <table id="tblToolTip" visible="false" runat="server">
                                        <asp:Label ID="lblClientName" runat="server"></asp:Label>
                                        <asp:TextBox ID="txtTemplateName" runat="server"></asp:TextBox>
                                        <asp:Button ID="btnSave" OnClientClick="SaveTemplate(this); return false;" Text="Save"
                                            runat="server" />
     Protected Sub rjm_AjaxRequest(ByVal sender As Object, ByVal e As AjaxRequestEventArgs)
            Dim nTemplateID As Int32 = Convert.ToInt32(rcbTemplate.SelectedValue)
            Dim objTemplate As New TemplateInfo(nTemplateID)
            objTemplate.TemplateName = txtTemplateName.Text.Trim
            ScriptManager.RegisterClientScriptBlock(Me.Page, Me.GetType(), "Call my function", "CloseActiveToolTip()", True)
            Call GetAllTemplates()
        End Sub
      Protected Sub GetAllTemplates()
            If rcbClient.SelectedValue <> String.Empty Then
                Dim sSQL As String = "select ID, TemplateName from InvoiceTemplate where IsDeleted = 0 and ClientID = " & rcbClient.SelectedValue & " order By TemplateName"
                Dim oDataTable As DataTable = GMSDB.Query(sSQL)
                rcbTemplate.DataSource = oDataTable
                rcbTemplate.DataTextField = "TemplateName"
                rcbTemplate.DataValueField = "ID"
                rcbTemplate.Items.Insert(0, New RadComboBoxItem("- Select Template -", "- Select Template -"))
                rcbTemplate.DataSource = Nothing
                rcbTemplate.Items.Add(New RadComboBoxItem("- Select Template -", "- Select Template -"))
            End If
        End Sub
  2. Konstantin Dikov
    Konstantin Dikov avatar
    2466 posts

    Posted 28 Jun 2013 Link to this post

    Hello Muhammad,

    I have tested the described scenario on my side with various number of Items in the RadComboBox and I was unable to reproduce the issue.

    Attached you can find a simple project with ajaxified RadComboBox and RadToolTipManager in it.

      I noticed in your code that the RadComboBox data bind logic is implemented in the RadAjaxManager OnAjaxRequest server event.Note that this event fires in case manual ajaxRequest from the client is evoked. When an AJAX request is triggered using ajaxRequest function from the client, the AJAX Manager itself should be set as the AJAX initiator updating the corresponding control. See the help topic below for more information on this matter:

    Furthermore, as you are reporting that the RadComboBox hangs after the request, possible cause of this issue is having some js errors on the page. Therefore  you can check the browser console for any errors that may cause such unusual behavior.

    If you continue to experience this issue and In order for us to be of any further assistance, please open a support ticket and try to prepare a simple, fully runnable project that isolates just the problematic scenario and send it for inspection.

    Best Regards, Konstantin Dikov
    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