Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - custom datasource events
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

custom datasource events

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


Joined: 17 May 2006
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote RichardN Quote  Post ReplyReply Direct Link To This Post Topic: custom datasource events
    Posted: 17 May 2006 at 11:24am
Hi, I'm just getting started with Xtreme Calendar. I was wondering how the calendar control expects the data to be returned from the custom datasource events. For instance when implementing the DoReadEvent method. I would expect to write something like this (pseudocode):

Private Sub CalendarControl1_DoReadEvent(ByVal EventID As Long, pEvent As XtremeCalendarControl.CalendarEvent)

read recordset for event with id EventID
dim objCalendarEvent as calendarevent
Set objCalendarEvent = new calendarevent
set objcalendarevent properties
.
.
.
.
end properties

set pEvent = objCalendarevent

End Sub


instead, the only way to create a calendarevent object seems to be by referencing the dataprovider object in the calendar control itself.
If this is the case intentionally, how should I go about creating the object? should I use the createeventex method and presumably thereby add it to the calendar's collection of events? If so, why include pEvent as an argument?

Are there any examples of these custom events already being implemented anywhere?

Thanks,
Richard.


Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 17 May 2006 at 3:45pm
Hi Richard,

You're looking in a correct way. Just use DataProvider.CreateEventEx(EventID) method to create event object
instead of using new operator. This is implemented in such way to manage internal references between Event object and data provider which owns this event.

The pseudo code is:
 

Private Sub CalendarControl1_DoReadEvent(ByVal EventID As Long, pEvent As XtremeCalendarControl.CalendarEvent)

      ' read recordset for event with id EventID
 
      dim objCalendarEvent as calendarevent
      Set objCalendarEvent = CalendarControl1.DataProvider.CreateEventEx(EventID)
 
      ' set objcalendarevent properties
      .
      .
      .
      .
      ' end properties

      set pEvent = objCalendarevent

End Sub

 
There are also some other aspects for reccurrence events.
Look at Calendar VB sample, SQL Server example.
 
--
WBR,
Serge
Back to Top
RichardN View Drop Down
Newbie
Newbie


Joined: 17 May 2006
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote RichardN Quote  Post ReplyReply Direct Link To This Post Posted: 18 May 2006 at 4:33am
Thanks for the quick reply, I had a feeling it might work like that, the documentation isn't too clear about the way it should be done. Is that SQL server example available online, because the examples that came with the component don't appear to include any SQL server examples.
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 18 May 2006 at 5:27am
It is included in the standard suite installation. See \samples\Calendar\VB\CalendarSample -- SQL Server data provider (providerSQLServer.cls).

--
WBR,
Serge
Back to Top
RichardN View Drop Down
Newbie
Newbie


Joined: 17 May 2006
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote RichardN Quote  Post ReplyReply Direct Link To This Post Posted: 19 May 2006 at 10:49am
Thanks again, that was brilliant. I do have one other problem though. In a multiple schedules environment, is it possible to find out what scheduleid the selected time range is in when creating a new event.

If you look at the example files you can see that this feature is not implemented. Regardless of what schedule you had the selection for the default schedule for a new task is always John.
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 23 May 2006 at 5:43pm
Yes, I see that in current sample it's not implemented. However, that's easy - just get this value from HitTest info:

HitTest.ViewGroup.GroupIndex


--
WBR,
Serge
Back to Top
RichardN View Drop Down
Newbie
Newbie


Joined: 17 May 2006
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote RichardN Quote  Post ReplyReply Direct Link To This Post Posted: 24 May 2006 at 4:16am
Yeah, I think you misunderstood my question, I wanted to find out what the schedule ID of the selected range is, not the schedule id of an existing event. This would allow me to make a new task from a selection in the calendar without having to ask the user which schedule it is for.

I phoned tech support yesterday and they say that this is coming in the new release (out friday) under calendarcontrol.activeview.selection.groupindex
Thanks Guys!

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.203 seconds.