Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - Implementing custom event handlers in .NET
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Implementing custom event handlers in .NET

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


Joined: 31 August 2006
Location: Belgium
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote zotteLORRE Quote  Post ReplyReply Direct Link To This Post Topic: Implementing custom event handlers in .NET
    Posted: 31 August 2006 at 5:42am
Hi,


I'm busy evaluating the CalendarPro Active-X in a VB.NET dev enviroment for our company, and have encountered some problems implementing custom event handlers for a MySQL data source.

Implementing doRetrieveDayEvents & doCreateEvent, for example, works fine, but doUpdateEvent doesn't get fired at all.

I've implemented following code directly in the frmMain class:


        Private Sub CalendarControl_doRetrieveDayEvents(ByVal sender As System.Object, ByVal e As AxXtremeCalendarControl._DCalendarControlEvents_DoRetrieveDayEventsEvent) Handles CalendarControl.DoRetrieveDayEvents

            dbController.doQuerySelectEvents(e.dtDay, e.events, CalendarControl.DataProvider, nUserID)

        End Sub

        Private Sub CalendarControl_doCreateEvent(ByVal sender As System.Object, ByVal e As AxXtremeCalendarControl._DCalendarControlEvents_DoCreateEventEvent) Handles CalendarControl.DoCreateEvent

            dbController.doQueryInsertEvent(e.newEventID, e.pEvent, CalendarControl.DataProvider, nUserID, e.bResult)

        End Sub

        Private Sub CalendarControl_doUpdateEvent(ByVal sender As System.Object, ByVal e As AxXtremeCalendarControl._DCalendarControlEvents_DoUpdateEventEvent) Handles CalendarControl.DoUpdateEvent

            MessageBox.Show("test doupdateevent") 'temp
            'dbController.doQueryUpdateEvent(e.pEvent, CalendarControl.DataProvider, nUserID, e.bResult)

        End Sub


Am I wrong putting above code directly in the main form?

Thanks in advance,


Laurent
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: 01 September 2006 at 6:55am
Hi Laurent,

This is strange. I have just tested this -- added 3 empty handlers and all 3 events are coming fine.

DoUpdateEvent comes when you move/resize/edit existing event in the calendar.

My code is like the following:
Private
Sub frmMain1_Load( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase .Load
   CalendarControl.SetDataProvider("Provider=CUSTOM;")
   CalendarControl.DataProvider.Open() ' Ensure that you call Open!
End Sub

Private Sub CalendarControl_DoCreateEvent( ByVal sender As Object ,
   ByVal e As AxXtremeCalendarControl._DCalendarControlEvents_DoCreateEventEvent)
   Handles CalendarControl.DoCreateEvent
End Sub

Private Sub CalendarControl_DoRetrieveDayEvents( ByVal sender As Object ,
   ByVal e As AxXtremeCalendarControl._DCalendarControlEvents_DoRetrieveDayEventsEvent)
   Handles CalendarControl.DoRetrieveDayEvents
End Sub

Private Sub CalendarControl_DoUpdateEvent( ByVal sender As Object ,
   ByVal e As AxXtremeCalendarControl._DCalendarControlEvents_DoUpdateEventEvent)
   Handles CalendarControl.DoUpdateEvent
End Sub

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


Joined: 31 August 2006
Location: Belgium
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote zotteLORRE Quote  Post ReplyReply Direct Link To This Post Posted: 15 September 2006 at 8:08am
Serge,


Strange indeed, but I guess the problem was somewhere (?) in my code.

After lots of debugging, I decided to start from scratch and use the VB6 sample as an example (and read the documentation...).

A little bit embarassing, since I didn't manage to find the bug...

Anyway, everything works fine now!

Thanks for your time,


Laurent
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.172 seconds.