Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 11 MAY 2010 12:47:46PM Karl Pozmann wrote:

The following is taken from the Codejock website which describes how to use their calendar control. What's the best way to implement 'Addevent'?

Simple solution – custom load/save events code

Let's firstly consider a simplest case – you have a legacy database and just want to work with it on the single workstation, and you want to open and save all the changes with corresponding toolbar buttons (or any other way, the main idea is that database in not always synchronized with those which is show on the Calendar).

In this case the correct solution for you would be not to use a Custom Data Provider at all :)

All that you need is to use the standard Memory Data Provider, which is created with the Calendar control by default. Of course, it could be serialized into XML file, but if you do not provide the file name, Memory Data Provider will be a simple storage for your Events. You'll have to Populate the Calendar with your Events, and then allow user to work with them, and update all the data in the database on the moment of saving by iterating all Calendar Events. This might look in a following way:

Load:

' Load events

Sub Populate()

      objCalendar.DataProvider.RemoveAllEvents
  ' 
  ' 
      For each objEvent in objEventsCollection
      Set objCalendarEvent=objCalendar.DataProvider.CreateEventEx(objEvent.ID)
      objCalendarEvent.StartTime=...
      ...
      objCalendar.DataProvider.AddEvent objCalendarEvent    
  Next
  objCalendar.Populate

End Sub


At 11 MAY 2010 12:48PM Karl Pozmann wrote:

Forgot to mention this is for OI 7.2.2


At 11 MAY 2010 11:43PM Bob Carten wrote:

Karl,

That snippet of documentation suggests you have a hard slog ahead of you, especially with 7.22. They are using the word 'Event' in a way that sounds more like VB .Net than Vb6/COM. You might want to check out the SRPCS Date picker control

- Bob


At 12 MAY 2010 02:25PM Karl Pozmann wrote:

Thanks, Bob - that's why I posted it here! ;) Anyhow, it also supports MAPI but

1. Cancelling/Deleting appointments

          and

2. Working with other calendars (without any user intervention)

was proving tedious, unless of course you or anyone else has any new ideas.

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/fa7a63146ba7b07385257720005c43de.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1