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

RadAjaxPanel - RadToolTipManager and usercontrol

1 Answer 90 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
jc mag
Top achievements
Rank 1
jc mag asked on 08 Mar 2011, 01:34 PM
I have a RadTreeview and I display a RadTooltip on its nodes using a RadTooltipManager:

<telerik:RadTreeView ID="treeSubBooks" runat="server" Skin="WebBlue" AllowNodeEditing="false"
                    EnableDragAndDrop="false" OnNodeClick="tree_NodeClick" Width="240px">
                </telerik:RadTreeView>
                 <telerik:RadToolTipManager ID="rttmSubBooks" Height="300px" Width="250px"
                    HideEvent="ManualClose" RelativeTo="Element" Position="MiddleLeft"
                    runat="server" ShowDelay="500" Skin="Telerik" EnableShadow="true" Animation="Fade"
                    OnAjaxUpdate="rttmSubBooks_AjaxUpdate">
                </telerik:RadToolTipManager>

The tooltip displays a usercontrol:
 
protected void rttmSubBooks_AjaxUpdate(object sender, ToolTipUpdateEventArgs e)
    {
        Control ctrl = LoadControl("~/UserControls/ucTooltipTreeviewBook.ascx");
        e.UpdatePanel.ContentTemplateContainer.Controls.Add(ctrl);
  
        var iuser = (IUserControl)ctrl;
        iuser.Parameter = e.Value;
        var action = (ITooltipTreeviewAction)ctrl;
        action.Action += tooltip_action;
    }
  
    private void tooltip_action(object sender, TooltipTreeviewEventArgs e)
    {
        buildSubBooks(e.Action, e.BookName);
    }

In the ucTooltipTreeviewBook usercontrol there is a LinkButton that executes the "Action" event, then my buildSubBooks method is called and the treeview nodes are updated.
All of that is included in a RadAjaxPanel.
:)

Now the problem is that the page is not refreshed when I click on the LinkButton in the tooltip. But if I click on another LinkButton in the page, the RadTreeview is well updated (with the buildSubBooks modifications).
Is it because the usercontrol is loaded dynamically and the RadAjaxPanel doesn't know it? Or did I do something wrong?



1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 11 Mar 2011, 10:17 AM
Hello jc mag,

 As far as I understand you have the treeview inside the ajax panel and you want to update it on some event fired from inside the tooltip. If so, please note that when the OnAjaxUpdate event is used (as in your case) the content of the tooltip is inside a built-in update panel (which is used to load the content through AJAX) and in such case only the content of that update panel is updated and not the rest of the page.

What I suggest is to replace the ajax panel with a standard asp update panel with UpdateMode="Conditional". At the desired event, when you want to update the main page tree, call the Update() method of the update panel - this will update its content as well.

Regards,
Svetlina
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
ToolTip
Asked by
jc mag
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or