Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Exchanging data between Calendars (Read 4762 times)
newuser
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Jan 13th, 2010
Exchanging data between Calendars
Jan 13th, 2010 at 6:22pm
Print Post  
Meppy,
My set up is using the planner.net calendar control on a VB 2005 windows form. I’m trying to do a few straightforward things, but struggling to implement.
I have a main calendar form that is in the monthview mode showing all 12 months. I want to give the user the ability to simply double-click on a particular day and open another windows form that has a different calendar in the timeview mode. On the timeview calendar, I want to give the user the ability to add, modify or delete appointments using standard forms. The part that I am struggling with is “cloning” (if I am using the term correctly) or simply copying the appointments on a given day on the main calendar over to the subordinate calendar and then reversing the process once the user makes their changes. It’s probably just a few lines of code on both forms, but I’m stuck. Any help appreciated. BTW, I looked at ALL the examples including DualView and none really fit my situation.
Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Exchanging data between Calendars
Reply #1 - Jan 13th, 2010 at 7:09pm
Print Post  
Hi,

More than one Calendar instances can display the same Schedule. So you could pass the Schedule object from the main calendar to the new form and assign it to the timetableCalendar.Schedule property.

If you prefer using different Schedule instances, e.g. in order to easily revert the changes, you could use the SaveToString and LoadFromString methods to copy the schedule items from the first calendar to the second one.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
newuser
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Jan 13th, 2010
Re: Exchanging data between Calendars
Reply #2 - Jan 13th, 2010 at 8:29pm
Print Post  
So simple, works great, thanks!
  
Back to top
 
IP Logged
 
newuser
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Jan 13th, 2010
Re: Exchanging data between Calendars
Reply #3 - Feb 13th, 2010 at 8:26pm
Print Post  
Thanks Stoyan, I have set up appointments that span the weekends for a year and when I count the appointments using GetAllItems I get the correct count of 52. However, when I drill down the timetable view nothing appears to show. When I create a single appointment spanning 24 hours I notice the same behavior. Is there a way to show an appointment that for example starts 3:30 PM on a Saturday and ends 6:pm on a Sunday? Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Exchanging data between Calendars
Reply #4 - Feb 14th, 2010 at 11:07am
Print Post  
Hi,

Don't such appointments show in the all-day header at the top of the timetable view?

Stoyan
  
Back to top
 
IP Logged
 
newuser
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Jan 13th, 2010
Re: Exchanging data between Calendars
Reply #5 - Feb 14th, 2010 at 2:11pm
Print Post  
I see no change in the calendar at all. I would also expect to see the appointment show at 3:30 on the beginning day and 6 on the ending day. The timetable shows one day so the header would not provide a lot of information about the appointment, but I see no change in the header at all. thanks
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Exchanging data between Calendars
Reply #6 - Feb 15th, 2010 at 7:16am
Print Post  
Try settings TimetableSettings.EnableDayItems to Disabled.

Regards,
Meppy
  
Back to top
 
IP Logged
 
newuser
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Jan 13th, 2010
Re: Exchanging data between Calendars
Reply #7 - Feb 20th, 2010 at 6:15pm
Print Post  
Thanks, that did the trick!
  
Back to top
 
IP Logged
 
newuser
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Jan 13th, 2010
Re: Exchanging data between Calendars
Reply #8 - Feb 27th, 2010 at 10:01pm
Print Post  
I have set up a simple monthview calendar. I have successfully created appointments and they show up as expected. But what I am trying to do is to easily read, modify, and write changes to appointments (items?) programmatically in a simple manner. I do not understand a simple way to do that. Ultimately, I would like to use the calendar to hold my modifications for different types of appointments such as holidays, vacation etc. For example, I would like to populate the calendar schedule with a years worth of holidays and then either make them visible or invisible at the user’s discretion while maintaining other non-holiday appointments. My thought was to uniquely tag a particular appointment types and then cycle through the schedule over a given range to enable or disable the viewing or counting of appointment types. Alternatively, I could use a file or database to contain the information and simply rewrite the data whenever the user desired to make a change. It seems strange to go through that extra trouble when this incredibly capable calendar control can probably accommodate everything I’m trying to achieve. Examples on how to read, modify, and write changes to appointments both singularly and over a date range and advice on distinguishing appointment types would by much appreciated. Also is my vision to simply use the schedule to store the information really practical or am I better off setting up a parallel processing scheme as described above? Last question; is there a way to get monthview calendar printouts that look like a calendar as opposed to a tabular listing? I’m happy to buy another tool if necessary. Thanks.



  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Exchanging data between Calendars
Reply #9 - Mar 1st, 2010 at 7:37am
Print Post  
The simplest way to distinguish between appointments would be to assign a specific value describing the appointment type to the Item.Tag property. For example, assign 0 for vacations, 1 for holidays, and so on (or use an enumeration). You can later check the Tag property in order to determine the appointment type.

A more sophisticated method (if for example you wish to associate additional information with the appointments) would be to create your custom appointment class by deriving from Appointment. Then you can implement an AppointmentType property, which would be similar to the tag above. You can also implement a method which returns only the appointments of a specific type within a specific date range. Then cycle through the returned collection and perform the necessary action over those appointments (such as hiding or showing them).

As for how to store the changes, a simple solution would be to write them to a file (by using Schedule.SaveTo method). When the application is started, you load the appointments from the file, the user makes certain changes, which remain in-memory until the application is closed, when you write the changed schedule back to the file.

To print the control as WYSIWYG, use the Calendar.Print method.

Regards,
Meppy
  
Back to top
 
IP Logged
 
newuser
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 7
Joined: Jan 13th, 2010
Re: Exchanging data between Calendars
Reply #10 - Mar 4th, 2010 at 1:56am
Print Post  
thanks
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint