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

    Hi,

    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">
                            </telerik:RadComboBox>
                            <asp:LinkButton ID="btnAddTemplates" Text="Add/Edit Template" Visible="false" runat="server">                           
                            </asp:LinkButton>
                            <telerik:RadAjaxManager ID="_RadAjaxManager" OnAjaxRequest="rjm_AjaxRequest" runat="server">                           
                                <AjaxSettings>
                                    <telerik:AjaxSetting AjaxControlID="btnSave">
                                        <UpdatedControls>
                                            <telerik:AjaxUpdatedControl ControlID="rttm"></telerik:AjaxUpdatedControl>
                                            <telerik:AjaxUpdatedControl ControlID="rcbTemplate"></telerik:AjaxUpdatedControl>
                                            <telerik:AjaxUpdatedControl ControlID="rgInvoiceTemplateDetail"></telerik:AjaxUpdatedControl>
                                        </UpdatedControls>                                   
                                    </telerik:AjaxSetting>                               
                                </AjaxSettings>
                            </telerik:RadAjaxManager>
                            <telerik:RadToolTipManager ID="rttm" runat="server" Position="TopRight" Animation="Fade"
                                ShowEvent="OnClick" HideEvent="ManualClose" OnAjaxUpdate="OnAjaxUpdate" RelativeTo="Element"
                                Width="250px" Height="250px" RenderInPageRoot="true">
                                <TargetControls>
                                    <telerik:ToolTipTargetControl TargetControlID="btnAddTemplates" />
                                </TargetControls>
                            </telerik:RadToolTipManager>
                            <table id="tblToolTip" visible="false" runat="server">
                                <tr>
                                    <td>
                                        Client
                                    </td>
                                    <td>
                                        <asp:Label ID="lblClientName" runat="server"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Template
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtTemplateName" runat="server"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                          
                                    </td>
                                    <td>
                                        <asp:Button ID="btnSave" OnClientClick="SaveTemplate(this); return false;" Text="Save"
                                            runat="server" />
                                    </td>
                                </tr>
                            </table>
     
     
     
     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
            objTemplate.Update(nTemplateID)
            ScriptManager.RegisterClientScriptBlock(Me.Page, Me.GetType(), "Call my function", "CloseActiveToolTip()", True)
     
            Call GetAllTemplates()
     
        End Sub
     
      Protected Sub GetAllTemplates()
     
            rcbTemplate.Items.Clear()
     
            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.DataBind()
                rcbTemplate.Items.Insert(0, New RadComboBoxItem("- Select Template -", "- Select Template -"))
     
            Else
     
                rcbTemplate.DataSource = Nothing
                rcbTemplate.DataBind()
                rcbTemplate.Items.Add(New RadComboBoxItem("- Select Template -", "- Select Template -"))
     
     
     
            End If
     
     
     
        End Sub
  2. Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1793 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:
    http://www.telerik.com/help/aspnet-ajax/ajax-client-side-api.html

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