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

[Solved] Loading Scheduler dynamically

5 Answers 161 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Rune
Top achievements
Rank 2
Rune asked on 12 May 2009, 06:17 AM
Hi

I am trying to figure out if RadControls can be integrated in a Dynamicweb CMS. For that to be possible all controls must be dynamicly loaded and written to a Placeholder. This seems to be possible with the smaller RadControls but I am having problems with the Scheduler.

I have taken the "first look" example, and put it into an ascx control. This is then loaded into the DOM with the LoadControl() method. First I did it the "normal" way, loading it in the frontend markup. That worked perfectly. But with LoadControl() the ajax works first time I click on something. After the controls have done their thing (Per example loading another day or changing the view from day to month) the whole Ajax part of the controls seems to disappear. If I click again the page reloads as if clicking on a <a href="#">link</a> tag.

This seems very strange to me. Am I doing anything wrong?

Regards
Rune

5 Answers, 1 is accepted

Sort by
0
Rune
Top achievements
Rank 2
answered on 12 May 2009, 07:18 AM
After more testing today I have found the problem. The problem lies in these lines of code:

<telerik:AjaxSetting AjaxControlID="RadScheduler1">  
    <UpdatedControls> 
        <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
    </UpdatedControls> 
</telerik:AjaxSetting> 

It seems that if a Control is linked to itself in the ajax settings it wont work when the control is loaded dynamically. This means that the problem was not scheduler specific but a general problem. So now I have two new questions

Why is this a problem?

And can the RadAjaxLoadingPanel1 be triggered in any other ways, not destroying the page?
0
Rune
Top achievements
Rank 2
answered on 12 May 2009, 08:46 AM
Ok, I can see the above really IS a problem. Without the AjaxSetting for RadScheduler1 the Scheduler's ajax does not work when just clicking around in the scheduler.

The same thing happens with the RadCalendar, when skipping through the months. First event works, and then it links to # no matter what I click.

This means the Controls does not work for me. Are there fix for this problem?
0
Peter
Telerik team
answered on 12 May 2009, 09:33 AM
Hi Rune,

If you need to ajaxify controls in a user control you should use RadAjaxManagerProxy. Please, review the help topic and let us know if you need further assistance.


Best wishes,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Rune
Top achievements
Rank 2
answered on 12 May 2009, 10:28 AM
Thank you for your fast answer.

I can see where you are going with that. Unfortunately I cannot use it.

In my scenario All my code must be placed in one single usercontrol. Form tags and all. This usercontrol is then dynamicly loaded into the page. At any given time, only one usercontrol can be added to the page.

As I wrote, it works perfectly when adding my usercontrol in the markup. It's only failing when I load it dynamically, and that is my only option. If I can overcome that problem, your controls have great potential for us.
0
Accepted
Peter
Telerik team
answered on 12 May 2009, 12:14 PM
Hi Rune,

Can try then wrapping the placeholder in a RadAjaxPanel. For example:

 <asp:ScriptManager ID="ScriptManager1" runat="server">  
    </asp:ScriptManager> 
    <telerik:RadAjaxPanel ID="RadAjaxPanel" runat="server">  
        <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder> 
   </telerik:RadAjaxPanel> 

 protected void Page_Load(object sender, EventArgs e)  
    {          
            Control scheduler = LoadControl("scheduler.ascx");  
            PlaceHolder1.Controls.Add(scheduler);  
     } 


Greetings,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Scheduler
Asked by
Rune
Top achievements
Rank 2
Answers by
Rune
Top achievements
Rank 2
Peter
Telerik team
Share this question
or