Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Custom day cell drawing on monthly calendar view (Read 9104 times)
jlavery
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 8
Joined: Feb 7th, 2006
Custom day cell drawing on monthly calendar view
Feb 7th, 2006 at 12:18pm
Print Post  
Hi,
I'm looking for a calendar control for a new application we're desigining, and Planner.NET looks ideal - but...

What I need to be able to do is colour specific days in the calendar according to data we've got about them. 

Why?  Well, the system is to be used to manage shift patterns for workers, and we need to be able to show which shifts are active on the days of the month. 

Each shift can be given its own colour (elsewhere in the system), so what I would like is to be able to display the colours of the active shifts in a date's cell in the month view. (And also the shift names, if possible.)

Is this possible in Planner.NET?

Thanks,

James
  
Back to top
 
IP Logged
 
jlavery
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 8
Joined: Feb 7th, 2006
Re: Custom day cell drawing on monthly calendar vi
Reply #1 - Feb 7th, 2006 at 1:46pm
Print Post  
Answered my own question.  Cheesy

Just needed to set CustomDraw to DayContents and then handle it in the Draw event.

Cool!
  
Back to top
 
IP Logged
 
jlavery
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 8
Joined: Feb 7th, 2006
Re: Custom day cell drawing on monthly calendar vi
Reply #2 - Feb 7th, 2006 at 1:55pm
Print Post  
Ah, not quite.  Undecided

When I set the theme to Windows 2003, my code stops having any effect.

Suggestions?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Custom day cell drawing on monthly calendar vi
Reply #3 - Feb 7th, 2006 at 1:59pm
Print Post  
That's great Smiley Anyway we had created a small custom drawing example before I saw you managed to do it, here it is:

https://mindfusion.org/_samples/Shifts.zip

It actually shows two methods for custom-coloring days in a SingleMonth view.

The first one uses the built-in custom formatting for days and day ranges. It allows for simpler, but more limited way to customize days' appearance.

The second one implements custom drawing by handling the Draw event.

Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Custom day cell drawing on monthly calendar vi
Reply #4 - Feb 7th, 2006 at 2:19pm
Print Post  
In that theme the day header height might be as big as the whole cell. Try explicitly setting the header space using the calendar.DaySettings.HeaderSize property after setting the theme.
  
Back to top
 
IP Logged
 
jlavery
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 8
Joined: Feb 7th, 2006
Re: Custom day cell drawing on monthly calendar vi
Reply #5 - Feb 7th, 2006 at 2:30pm
Print Post  
Aha!  Thanks - this is beginning to look great!

Thanks for excellent support.

Now I know I can do what we want with the control, I can get on with specifying the system for our customer.  If we get the contract, I'll be using Planner.NET!   Cheesy

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Custom day cell drawing on monthly calendar vi
Reply #6 - Feb 7th, 2006 at 3:08pm
Print Post  
We wish you luck with getting that conract  Wink
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint