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

[Solved] Appoitments template

6 Answers 209 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Jean-Luc
Top achievements
Rank 1
Jean-Luc asked on 12 Aug 2008, 07:26 PM
I have 3 type of appointment and I need 3 different appearance, not simply a different color but different content. Currently I have a blank template and  I add control depending on the type in appointmentCreated. I would like to know if someone knows a better way.

Thanks
Jean-Luc

6 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 14 Aug 2008, 11:14 AM
Hello Jean-Luc,

Unfortunately, you do not have many options in this scenario. I think your solution is pretty good, the alternative being using one template that "adapts" to the content. But your approach results in better code separation.

Sincerely yours,
Tsvetomir Tsonev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jean-Luc
Top achievements
Rank 1
answered on 14 Aug 2008, 02:09 PM
Hi!
But now I try to use loadtemplete

I tried to use the template this way:
    Private Sub RadScheduler_AppointmentCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.AppointmentCreatedEventArgs) Handles RadScheduler1.AppointmentCreated 
 
        e.Container.Template = Page.LoadTemplate("bob.ascx") 
 
    End Sub 

and in bob.ascx:
<%@ Language="vb"%> 
<asp:label id="ooo" Text="l 


But when running the label is not displayed in the appointment. I would like to know if this is a limitation of your control or whether it is possible that this function. If yes, What I need to implement in my usercontrole? If not, it would be interesting to proceed in a manner similar (a new feature maybe)

Thanks again
0
Accepted
T. Tsonev
Telerik team
answered on 18 Aug 2008, 09:41 AM
Hello Jean-Luc,

The template is already instantiated by the time that the AppointmentCreating event is raised. You should instantiate it explicitly, like this:

private void RadScheduler1_OnAppointmentCreated(object sender, AppointmentCreatedEventArgs e) 
    ITemplate template = LoadTemplate("bob.ascx"); 
    template.InstantiateIn(e.Container); 
 

I hope this helps.

Sincerely yours,
Tsvetomir Tsonev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jean-Luc
Top achievements
Rank 1
answered on 18 Aug 2008, 01:24 PM
Thank you, it works very well

Jean-Luc
0
SKS
Top achievements
Rank 1
answered on 29 Aug 2009, 11:50 PM
hi
i have 3 different table that have 3 different types of appointments data
meeting,event and time off.
how do you show all three on the radscheduler?

thanks
0
Peter
Telerik team
answered on 31 Aug 2009, 02:24 PM
Hello,

You need to create a single data source from these three tables. You can use resources to describe the type of the appointment - whether it is a meeting, an event or time off. Here is an example on defining resources: http://demos.telerik.com/aspnet-ajax/scheduler/examples/resources/defaultcs.aspx.


Best wishes,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Scheduler
Asked by
Jean-Luc
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Jean-Luc
Top achievements
Rank 1
SKS
Top achievements
Rank 1
Peter
Telerik team
Share this question
or