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

LoadOnDemand + Load Control from another UserControl + Access Properties

2 Answers 107 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 23 Jan 2009, 05:28 PM
Ok so i am using SiteFinity and playing with the RadToolTipManager. Because this is SiteFinity, my RadToolTipManager is inside a UserControl. That said i am trying to dynamically load the UserControl for the RadToolTipManager from this UserControl... Now that i have confused everyone sufficients, i am also trying to access properties within the RadToolTipManager Control i am loading Dynamically. I am frustrated cause none of the example on the Telerik site show the code behind of the user control.

I need help and i need help BAD...

So here are the details:

Results.ascx.cs

On an ItemDatabound mothd i add the control to the RadToolTipManager
RadToolTipManager1.TargetControls.Add(((Label)rpti.FindControl("lblFlightNum")).ClientID, ""true); 

As per the examples the code behind here has the following methods which the RadToolTipManager calles:
    protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args) 
    { 
        this.UpdateToolTip(args.Value, args.UpdatePanel); 
    } 
 
    private void UpdateToolTip(string elementID, UpdatePanel panel) 
    { 
        Control ctrl = Page.LoadControl("~/UserControls/PFV_3.0_TooltipControls/FlightInformation.ascx"); 
        panel.ContentTemplateContainer.Controls.Add(ctrl); 
 
        //ProductDetails details = (ProductDetails)ctrl;
        //details.ProductID = elementID; 
    } 

Notice above i have commented out the lines where the property on the loaded control is accesses as i do not know how ProductDetails is inherited down and there is no explaination of this anywhere... If it were part of the ASPX page i might be able to access it but in my case it is part of a ASCX UserControl and being loaded dynamically.

So here is my UserControl i am trying to LoadOnDemand

FlightInformation.ascx.cs

using System; 
using System.Data; 
using System.Configuration; 
using System.Collections; 
using System.Web; 
using System.Web.Security; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using System.Web.UI.WebControls.WebParts; 
using System.Web.UI.HtmlControls; 
 
public partial class UserControls_TooltipControls_FlightInformation : System.Web.UI.UserControl 
    string ParameterArray; 
    public virtual string Parameters 
    { 
        get 
        { 
            return ParameterArray; 
        } 
        set 
        { 
            ParameterArray = value; 
        } 
    } 
 
    protected void Page_Load(object sender, EventArgs e) 
    { 
 
    } 


Can someone please help me load this control Dynamically and have access to it property from the OnAjaxUpdate method!

Thanks in advance,

Duncan


2 Answers, 1 is accepted

Sort by
0
Mike
Top achievements
Rank 1
answered on 23 Jan 2009, 08:50 PM
Disregard please. I have resolved this issue!

Thanks
0
InfySam
Top achievements
Rank 1
answered on 10 May 2012, 10:48 PM
Can you please post how you were able to resolve the issue. I am facing a similar issue. I have no idea why OnAjaxUpdate event isn't fired. On inspection into View Source I found that LoadOnDemand property of RadTooltipManager is set to false. I have no idea how to make this true because I suspect this will trigger OnAjaxUpdate event.
Tags
ToolTip
Asked by
Mike
Top achievements
Rank 1
Answers by
Mike
Top achievements
Rank 1
InfySam
Top achievements
Rank 1
Share this question
or