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

settings AllAppointments Source

1 Answer 61 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Denny
Top achievements
Rank 1
Denny asked on 10 May 2013, 04:32 AM
If I wanted to use the structure that is supplied in the example source code for the calendar controls, how would I set the StartDate and EndDate for scheduled events?

If I use the StarteDate = DateTime.Now
                EndDate = DateTime.Now.addHours(1)

Isn't this always going to use the current system time for the start time and then add 1 hour for the end date?

I want to set the schedule to stick to a particular date. Such as May 20, 2013. So that no matter when the user looks at the calendar the May 20,2013 appointment will always be on the schedule.

I know I can load a XML file or whatever other source, I'm just trying to get a feel for the controls and make sure the way I want the event to look..

And also if I did want to use a XML file would I point the public SampleAppointmentSource() to the XML? and would that be a navigationService?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 14 May 2013, 03:20 PM
Hi Denny,

Thank you for contacting us.

I have attached a sample where the appointments are created dynamically, which I believe you can find useful. If you want to have the appointments in an XML, text or other type of file, you can read the content of the file and parse it somewhere inside the SampleAppointmentsSource constructor or inside the MainViewModel. Then you can add the parsed DateTime objects to the AllAppointments collection. Neither StartDate, nor EndDate have to be related to DateTime.Now. You can create whatever DateTime objects you need.

All the best,
Todor
the Telerik team
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
Calendar
Asked by
Denny
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or