Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Calendar
  New Posts New Posts RSS Feed - HOWTO: Identify an Unsaved Event
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

HOWTO: Identify an Unsaved Event

 Post Reply Post Reply
Author
Message
DDJJ View Drop Down
Senior Member
Senior Member


Joined: 13 December 2004
Status: Offline
Points: 143
Post Options Post Options   Thanks (0) Thanks(0)   Quote DDJJ Quote  Post ReplyReply Direct Link To This Post Topic: HOWTO: Identify an Unsaved Event
    Posted: 11 October 2006 at 11:24pm
EXAMPLE: Our app's user opens a form containing the calendar control, selects a time period on the calendar using a mouse, then starts typing a subject for the selected time period.
 
At this point we want the user to be able to click on a Save button to save the details regarding the selected time period to our database.
 
The problem is that at this particular point the calendar control has not saved an event.  When we check for any events to save(CalendarControl1.DataProvider.GetAllEventsRaw.Count), we get 0.
 
If the user hits "Enter" after typing whatever, we're OK because the event is saved.  The same is true if the user moves off of the unsaved event and clicks somewhere alse on the calendar...the event is then automatically saved.
 
Two questions.  One, how can we test in this kind of situation to see if the user has started to create an event, but didn't complete the action.  I was thinking along the lines of comparing the number of saved events (GetAllEventsRaw.Count) to the number of "selections" in the active view...but don't seem to be able to get where I want to get.
 
Second (probably answered by the answer to the first question)...how would I just automatically save the unsaved event without prompting the user to do so.
 
Please let me know if this doesn't make sense.
 
Thanks,
 
Dan
 
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: 12 October 2006 at 4:30am
Note that after user started typing something, he still can cancel creation of this new event by pressing Esc.

Answer for the first question is to handle BeforeEditOperation notification. There is a special operation type (OpParams.Operation = xtpCalendarEO_InPlaceCreateEvent) which is fired when user started typing.

Next event which you can handle is SelectionChanged, and it will contain a pointer to a newly created event (however, note that its subject will still be empty by the end of editing).

Your second question about automiatic saving of unsaved event have no answer. After in-place event creation a regular Subject editing is started. This operation do not save each keypress, a subject is changed only after editing is finished (whether by pressing Enter or by clicking outside).

--
WBR,
Serge
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.125 seconds.