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

RadAjaxManager Update Controls

1 Answer 129 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Muhammad
Top achievements
Rank 1
Muhammad asked on 25 Jun 2013, 12:43 PM
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

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 28 Jun 2013, 08:15 AM
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.
Tags
Ajax
Asked by
Muhammad
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or