Events not visible with custom dataprovider
Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=16866
Printed Date: 06 July 2025 at 7:49am Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: Events not visible with custom dataprovider
Posted By: RK007
Subject: Events not visible with custom dataprovider
Date Posted: 22 June 2010 at 3:50am
I have a little problem to get my appointments visible when using a custom dataprovider. I think it is related to the moment I read the information, but I cannot figure out what is the right moment/event to read the information. It works fine when using 'memory' as dataprovider, but then I miss a lot of flexibility/functionality I would like to implement.
So let me try to explain in short what I try to accomplish. We have an inhouse developed language, which is able to communicate with COM objects. So I try to implement the CalendarControl by 'translating' the examples. It should be possible to show the appointments for one or more persons for a couple of weeks. The appointments have to be retrieved from two locations: an Oracle database and data stored on disk (.ics files). When an appointment is modified, the modifications should be saved at both locations.
What I achieved right now is:
- one custom dataprovider
- a resource/schedule for each person
- the appointments are retrieved and stored in the CalendarEvents when the DoGetAllEventsRaw is fired
- for each appoinment an event is created (CalendarDataProvider.CreateEvent()) and added to the events parameter (Events.Add())
- at the the Populate() and RedrawControl() methods are called
Despite the fact that the appointments are in the Events collection they are not shown in the Calendar. I think the moment the Events collection is filled might not be the correct moment, but I cannot figure out what the right moment should be. Or can it be related to the fact that I do not assign an EventID in the DoCreateEvent event (which doesn't seem to be fired by the way)? Can anybody give an indication when exactly do I have to read the appointments and how can I make them visible in the Calendar?
|
Replies:
Posted By: RK007
Date Posted: 23 June 2010 at 3:12am
It looks like I have been able to solve it. First of all I do not load the appointments with the DoGetAllEvents, but when my form is loaded. Additionally to test my single user calendar I put the scheduleID of all apointments fixed to 0 because I thought that was the default, but it should have been 1. Now my appointments do show up in the calendar.
The only thing that is not working properly yet are the highlighted days in the datepicker. When I open the calendar in dayview only the actual day (if it has appointments) is shown in bold. When I open the calendar in weekview only the days of the week that have appointments are shown bold. After switching to another view all days that have an
appointment are shown in bold. Any ideas?
I already tried Populate(), RedrawControl() and DetachFromCalendar in combination with AttachToCalendar().
|
Posted By: RK007
Date Posted: 01 July 2010 at 9:10am
I built next workaround to get all days with appointments highlighted in the DatePicker:
originalViewType := CalendarControl.viewtype // save actual ViewType CalendarControl.viewtype := 0 // Switch to DayView CalendarControl.DayView.ShowDays(start_date, end_date) // needed to get all dates highlighted CalendarControl.DayView.ShowDays(today, today) // needed to avoid that all days of all months are shown when switching to monthview CalendarControl.viewtype := originalViewType // return to original ViewType
|
|