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

RadTootipManager updating

5 Answers 66 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Keelan
Top achievements
Rank 1
Keelan asked on 20 Mar 2009, 11:12 AM
Hi all,

I have a little problem, certainly based on page lifecyle, but I don't see how to correct it.

My web site contains a MasterPage (called MP for this example). MP contains a Page (called P here) and a radtooltip manager. In P, there is a lot of usercontrol (with ascx extension) that are loaded dynamically with LoadControl(...) methods.

Take one user control (UC1) from P for our example. In UC1, there is another usercontrol (UC2) wich contains a picture and a drop down list.

I've wrote code that tooltipify the picture in UC2, through a MasterPage method. This works fine. But, when I've changed a value on my drop down list, I've called another MasterPage method to change the value of the ToolTipTargetControl. Altought my method find correctly in the TargetControls collection the designed tooltip, the value is not changed in the product source code.

The amazing comportment is that if UC1 is set by design mode in P (so, not by LoadControl method), all works perfectly.

Any Idea ?

Regard.

5 Answers, 1 is accepted

Sort by
0
Tervel
Telerik team
answered on 23 Mar 2009, 04:18 PM
Hi Keelan,

Indeed your scenario with 5-level nesting seems a bit complicated. If I was able to follow your explanations correctly you try to tooltipify an image located in Master Page -> Page -> User Control 1 -> Nested User Control -> Image.

Since you mention that it all works when set declaratively, my first guess would be that your DropDown or parent User control employs AJAX to preform some server-side settings change. If that is the case, please make sure that the RadToolTipManager control is among the controls that get updated as a result of this AJAX call. It is not enough to change something on the server, and assume that all changes will be transfered on the client automatically.

If you are not using AJAX, then I suggest viewing the source of the page after postback and examining the

Sys.Application.add_init(function() {
$create(Telerik.Web.UI.RadToolTipManager
tag at the bottom of the page - please make sure that the ID's listed in the TargetControls collection indeed exist on the page.

All the best,
Tervel
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Keelan
Top achievements
Rank 1
answered on 24 Mar 2009, 10:45 AM
Hi Tervel,

Thanks for your answer. I'm in the first case : my parent page use a RadAjaxManager and my UserControl use a RadAjaxManagerProxy. I understand what you mean when you said that the radtoolTip manager must be in the UpdatedControls list of the RadAjaxManager and I think you're right. But... how can I do this?

My RadToolTipmanager is in the MasterPage. So, I've wrote a read-only property to get it (Rim). In the user -control, I've tried on code-behind in many locations (InitPage, PageLoad, just before the call to the UpdateToolTipValue method in the master page)  by writing the following code :

Telerik.Web.UI.RadAjaxManager ram=Telerik.Web.UI.RadAjaxManager.GetCurrent(this.Page);  
if (ram!=null)  
{  
    ram.AjaxSettings.AddAjaxSetting(ddlID, ((Master_Sample)this.Page.Master).Rim);  

 

 or in the design :

<telerik:RadAjaxManagerProxy ID="rm" runat="server">  
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="ddlID">  
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="<%((Master_Sample)this.Page.Master).Rim %>" /> 
                <telerik:AjaxUpdatedControl ControlID="txtID" /> 
                <telerik:AjaxUpdatedControl ControlID="h" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManagerProxy> 
 
but nothing works. Please note that my Master Page dosen't contain any RadajaxManager(Proxy).

Have you any idea?

Regards.
0
Accepted
Svetlina Anati
Telerik team
answered on 30 Mar 2009, 09:00 AM
Hello Keelan,

I built up a test demo similar to the scenario you explain. It consists of a MasterPage and a ContentPage with a user control dynamically loaded in it. At the beginning the textbox in the user control is not tooltipified. When you change the selected item in the dropdownlist, the textbox is added to the RadToolTipManager's TargetControls collection and as you can see, the manager is correctly updated and the tooltip shows up when you hover the textbox.

In case you need further assistance, please modify the attached demo in order to reproduce the problem, open a new support ticket and send it to me along with detailed reproduction steps and explanations of the actual and the desired behavior.

Regards,
Svetlina
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Keelan
Top achievements
Rank 1
answered on 30 Mar 2009, 01:24 PM
Hello Svetlina,

Thanks a lot for your code. It really helps me. In fact, I had two errors:

  1. I called the RadAJaxManager of the master page in place of the RadAjaxManagerProxy of my UserControl. So the line
    Telerik.Web.UI.RadAjaxManager ram=Telerik.Web.UI.RadAjaxManager.GetCurrent(this.Page);     
    if (ram!=null)     
    {     
        ram.AjaxSettings.AddAjaxSetting(ddlID, ((Master_Sample)this.Page.Master).Rim);     
    must be replaced by
    this.rm.AjaxSettings.AddAjaxSetting(ddlID, ((Master_Sample)this.Page.Master).Rim); 
  2. The second mistake was to call this line in the Page_Load event but only when the page was not PostBack.

    Now, everything works fine.

    Thnaks you again.
0
Accepted
Tervel
Telerik team
answered on 30 Mar 2009, 02:01 PM
Hi Keelan,

We are glad to know that things are working now!

Best regards,
Svetlina
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
ToolTip
Asked by
Keelan
Top achievements
Rank 1
Answers by
Tervel
Telerik team
Keelan
Top achievements
Rank 1
Svetlina Anati
Telerik team
Share this question
or