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

[Solved] Getting start/end date from the Timeline Click

2 Answers 107 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Amarjit
Top achievements
Rank 1
Amarjit asked on 05 Apr 2009, 10:59 AM
Hi all,

I am using a rad scheduler and using custom usercontrols for inserting the appointments.
what i want is i want to display some fields selectively on the basis of the date and time slot clicked in the timeline in scheduler.

please help me to find that how can i get the start and end date before the advanced insert form is opened

Thanks & Regards,
Amarjit

2 Answers, 1 is accepted

Sort by
0
Accepted
Genady Sergeev
Telerik team
answered on 07 Apr 2009, 09:18 AM
Hi Amarjit,

You can obtain the StartDate and the EndDate of the timeslot in the FormCreating event of the RadScheduler. Example:

 protected void TheScheduler_FormCreating(object sender, SchedulerFormCreatingEventArgs e) 
    { 
        Session["startTime"] = e.Appointment.Start; 
        Session["endTime"] = e.Appointment.End; 
    } 


This event is fired before the user controls are loaded ( and the respective form opened), so you can use the saved values into your custom user controls. The correct syntax to access the session object in the user controls is:

DateTime startDate = (DateTime)HttpContext.Current.Session["startDate"]; 


Best wishes,
Genady Sergeev
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Amarjit
Top achievements
Rank 1
answered on 07 Apr 2009, 03:21 PM
Hi Genady,

Great it works perfect.

I had tried some other events but not this one.

Thanks a lot. 
How can i accept the answer 

Regards,
Amarjit
Tags
Scheduler
Asked by
Amarjit
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Amarjit
Top achievements
Rank 1
Share this question
or