Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - Events not visible with custom dataprovider
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Events not visible with custom dataprovider

 Post Reply Post Reply
Author
Message
RK007 View Drop Down
Newbie
Newbie


Joined: 18 June 2010
Location: Netherlands
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote RK007 Quote  Post ReplyReply Direct Link To This Post Topic: Events not visible with custom dataprovider
    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?

Back to Top
RK007 View Drop Down
Newbie
Newbie


Joined: 18 June 2010
Location: Netherlands
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote RK007 Quote  Post ReplyReply Direct Link To This Post 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().
Back to Top
RK007 View Drop Down
Newbie
Newbie


Joined: 18 June 2010
Location: Netherlands
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote RK007 Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.234 seconds.