Keep getting NullReferenceException in System.Drawing when I make an appointment that goes from (for example) October 6th 11:50pm into October 7th 2:00am.
Is there a fix for this? No source was provided so I can't fix this myself
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dan,
I got the same error initially, I discovered it's due to the fact that the item font isn't defaulted to anything, so if you add any items with text the draw fails. Try specifying a font (both for the calendar and the items) and you should be fine.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I know this post is over 1 year old, but I am getting the Null Reference when adding items in the
routine of WindowsFormsCalendar.CalendarRenderer.PerformItemsLayout
Is the the same as you have stated above?
I have fonts selected in both Calendar and Items and it still fails.
I do notice though, that the Calendar items do have the item loaded into it, so it must be something to do with placing it on the Calendar.
Are you able to help in anyway as this has been driving me crazy for 2 days.
Thanks,
Rob
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Keep getting NullReferenceException in System.Drawing when I make an appointment that goes from (for example) October 6th 11:50pm into October 7th 2:00am.
Is there a fix for this? No source was provided so I can't fix this myself
Dan,
I got the same error initially, I discovered it's due to the fact that the item font isn't defaulted to anything, so if you add any items with text the draw fails. Try specifying a font (both for the calendar and the items) and you should be fine.
It works, thanks.
Honestly - it should be added to sources - automatically init of ItemsFont property.
Last edit: D.J. Rutherford 2015-11-09
Hi, I know this post is over 1 year old, but I am getting the Null Reference when adding items in the
routine of WindowsFormsCalendar.CalendarRenderer.PerformItemsLayout
Is the the same as you have stated above?
I have fonts selected in both Calendar and Items and it still fails.
I do notice though, that the Calendar items do have the item loaded into it, so it must be something to do with placing it on the Calendar.
Are you able to help in anyway as this has been driving me crazy for 2 days.
Thanks,
Rob