Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Appointment exceeding Calendar.GetLastDate() is not visible (Read 8648 times)
doingSomeWork
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 14
Joined: Dec 6th, 2012
Appointment exceeding Calendar.GetLastDate() is not visible
Dec 6th, 2012 at 3:23pm
Print Post  
Hi,

We are currently evaluating your scheduling control (Version: 5.4.1.20046).
We have the issue when we define an Appointment which has an EndTime which is past the Calendar.GetLastDate() it is not displayed.
We have a custom paint EventHandler which evaluates GetVisibleItems(). As mentioned before items which exceed the visible range are missing - and therefore not painted Sad

Any idea is highly appreciated.

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


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Appointment exceeding Calendar.GetLastDate() is not visible
Reply #1 - Dec 7th, 2012 at 7:35am
Print Post  
Hi,

Do you mean that the Calendar.Draw event is not raised for these items or that they are not detected by the GetVisibleItems call? I'm testing across all views and the event seems to be raised consistently for partially visible items. Can you send me a sample illustrating the problem or provide additional information, such as which view are you using, how do you perform the custom drawing, and so on?

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


I Love MindFusion!

Posts: 14
Joined: Dec 6th, 2012
Re: Appointment exceeding Calendar.GetLastDate() is not visible
Reply #2 - Dec 7th, 2012 at 9:22am
Print Post  
Hi Meppy,

Sorry if I did not make myself clear enough. The problem is that calendar.GetVisibleItems() does not return the Appointment. And because of that I do not trigger my Appointment.Paint() event.

I did some more investigation.
The problem is not exactly when the Appointment is exceeding the "calendar.GetFirstDate()" or the "calendar.GetLastDate()".
The Problem is when the Appointment takes longer than the TimeSpan of "lastDate - startDate".
Meaning I show a complete day in the "CalendarView.Timetable" from 0:00 till 24:00. If I have an Appointment which starts yesterday at 20:00 and finishes today at 9:00 it works fine. But if the same Appointment finishes by 22:00 it is not returned by the GetVisibleItems().

Hope that makes it a little clearer,
Thomas
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Appointment exceeding Calendar.GetLastDate() is not visible
Reply #3 - Dec 7th, 2012 at 11:32am
Print Post  
Hi Thomas,

I understand the problem now, but I am unable to reproduce it with the latest version. Can you attach a small example application illustrating it? In the meantime you can try working around the Calendar.GetVisibleItems method by calling Calendar.Schedule.GetAllItems(Calendar.GetFirstVisibleDate(), Calendar.GetLastVisibleDate()) even though they are not exactly identical (GetAllItems may return items that are actually not visible).

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


I Love MindFusion!

Posts: 14
Joined: Dec 6th, 2012
Re: Appointment exceeding Calendar.GetLastDate() is not visible
Reply #4 - Dec 7th, 2012 at 12:20pm
Print Post  
Hi Meppy,

Your suggestion makes a big difference! Please see the attached screenshots.
You have indicated that the "additional" item might be not visible, but "Visible" is true.

I am not sure if I will be able to post a sample project today - it is already friday afternoon. But latest next week!

Thank you,
Thomas
  

GetAllItems.png (Attachment deleted)
GetVisibleItems.png (Attachment deleted)
VisibleDates.png (Attachment deleted)
Back to top
 
IP Logged
 
doingSomeWork
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 14
Joined: Dec 6th, 2012
Re: Appointment exceeding Calendar.GetLastDate() is not visible
Reply #5 - Dec 7th, 2012 at 12:31pm
Print Post  

It seems that I was too euphoric...
The item is indeed returned by GetAllItems(...) but when I call calendar.GetItemBounds(item) a get a nice Rectagle located at [0, 0] with a size of [0, 0].

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


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Appointment exceeding Calendar.GetLastDate() is not visible
Reply #6 - Dec 7th, 2012 at 1:10pm
Print Post  
Hi again,

Are you sure that the item is actually visible inside the current viewport? Calendar.GetItemBounds will return an empty rectangle for items that are not currently visible because their bounding rectangles have not been calculated. This will also explain why the item is not included in the GetVisibleItems result. Note, that the Item.Visible property does not necessarily indicate that the item is currently visible on screen. This property specifies whether the item should be visible if the item is inside the currently displayed time interval and is true for all items unless explicitly assigned by the user.

The item might not be visible due to grouping. For example, if the item is related to a resource, which is not included in the resources the view is currently grouped by, the item will not be displayed. Let me know if you are using grouping and if this is the case, what are your grouping settings.

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


I Love MindFusion!

Posts: 14
Joined: Dec 6th, 2012
Re: Appointment exceeding Calendar.GetLastDate() is not visible
Reply #7 - Dec 7th, 2012 at 1:34pm
Print Post  
Hi Meppy,

Thank you for your fast replies!
We are using "calendar.GroupType = GroupType.GroupByResources;" but this resource is definitely visible. Because when I split the Item into several ones (one for each day => current workaround) it works. At least for display only - moving and resizing is a pain though.

I will try to get the sample app running.

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


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Appointment exceeding Calendar.GetLastDate() is not visible
Reply #8 - Dec 7th, 2012 at 2:13pm
Print Post  
I suspect it might be the following:

By default items longer than one day are displayed in the all-day header of the Timetable view (above the column cells and just below the regular column header). This header however is not displayed in all themes. For example, it is not displayed in the default Standard theme. When an item is longer than one day and the all-day header is not enabled, the item is simply not displayed. If this is the case, you have two options:

1) You can enable the all day header, either implicitly by selecting a theme (such as Vista) where it is enabled, or explicitly, by setting Calendar.TimetableSettings.ShowDayHeader to Enabled.

2) You can prevent items longer than 1 day from being placed in the all-day header by setting Calendar.TimetableSettings.EnableDayItems to Disabled.

I hope this helps.

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


I Love MindFusion!

Posts: 14
Joined: Dec 6th, 2012
Re: Appointment exceeding Calendar.GetLastDate() is not visible
Reply #9 - Dec 7th, 2012 at 2:47pm
Print Post  
You are my hero!!!
Suggestions No. 2 is exactly what I was looking for!

Thank you so much for the excellent support!

Reminder to myself: First ask, then implement a workaround.
  
Back to top
 
IP Logged
 
doingSomeWork
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 14
Joined: Dec 6th, 2012
Re: Appointment exceeding Calendar.GetLastDate() is not visible
Reply #10 - Dec 7th, 2012 at 3:01pm
Print Post  
Hi Meppy,

I hope I can rely on your great support once more. I have the items in the calendar now. But I do not understand why the "extended" part of the item has a different color and mouse hover behaviour.
The one Appointment I am referring to, starts at the 8th of December and lasts till the 11th of December. Text: "Administrator: 001".

Thank you,
Thomas
  

NonHovered.png (Attachment deleted)
Hovered.png (Attachment deleted)
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Appointment exceeding Calendar.GetLastDate() is not visible
Reply #11 - Dec 7th, 2012 at 3:35pm
Print Post  
Hi,

You said earlier that you are performing custom painting on the items. Since you mentioned that you are manually obtaining the visible items and their bounding rectangles, I presume you are not using the built-in custom-drawing functionality.

Instead of enumerating the items manually in order to paint them, try setting Calendar.CustomDraw to TimetableItem, then handle the Calendar.Draw event. Now, this event will be raised every time an item is rendered in the Timetable view in order to allow you to custom draw it. The event will be raised repeatedly for the individual item fragments - for example, the event will be raised four times for each fragment of the "Administrator: 001" appointment. The bounding rectangle of the fragment being drawn can be obtained from the supplied DrawEventArgs object so you won't have to obtain it manually.

Let me know if this helps.

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


I Love MindFusion!

Posts: 14
Joined: Dec 6th, 2012
Re: Appointment exceeding Calendar.GetLastDate() is not visible
Reply #12 - Dec 7th, 2012 at 3:39pm
Print Post  
Hi Meppy,

You are presuming correct "you are not using the built-in custom-drawing functionality".
I will give it a try on Monday.

Have a nice weekend!
  
Back to top
 
IP Logged
 
doingSomeWork
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 14
Joined: Dec 6th, 2012
Re: Appointment exceeding Calendar.GetLastDate() is not visible
Reply #13 - Dec 13th, 2012 at 2:28pm
Print Post  
Hi Meppy,

Sorry to reply that late, but I had some problems to deal with.

It is working as proposed!

Thank you,
Thomas
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint