Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Set style for particular contact w/ GroupByContact (Read 2724 times)
SuperKing
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Oct 24th, 2008
Set style for particular contact w/ GroupByContact
Oct 24th, 2008 at 9:35pm
Print Post  
Hello,

When using a timetable with the GroupByContacts grouptype, I would like to be able to set a cellstyle for a particular contact in the timetable to indicate that they should not have appointments scheduled for them (ie. they are out for the day, or whatever). So if three contacts are shown in this view, I would want the "out of office" cellstyle for only one of the contacts, while the other two would continue to show the regular worktime cellstyle. Is this possible, or am I stuck with a single cellstyle for all contacts?

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


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Set style for particular contact w/ GroupByCon
Reply #1 - Oct 27th, 2008 at 8:25am
Print Post  
You can adjust the cell colors associated with a particular contact in the Timetable view through the object exposed by the contact's CustomBrushes property. The nonworking time cells associated with this contact will be painted with the PrimaryBrush object and the working time cells associated with the contact will be painted with the SecondaryBrush object. The following code associates a red and green brush with the nonworking and working time of an existing contact:

Code
Select All
contact1.CustomBrushes.PrimaryBrush = new MindFusion.Drawing.SolidBrush(Color.Green);
contact1.CustomBrushes.SecondaryBrush = new MindFusion.Drawing.SolidBrush(Color.Blue); 


Those associations can also be performed at design-time through the property grid.

Meppy
  
Back to top
 
IP Logged
 
SuperKing
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 5
Joined: Oct 24th, 2008
Re: Set style for particular contact w/ GroupByCon
Reply #2 - Oct 27th, 2008 at 9:37pm
Print Post  
Thanks for the reply Meppy.

That solves half of my problem; the other half is actually setting the contact's nonworking and working time. I can set these for the timetable itself (using the WorkTimeStartHour and WorkTimeEndHour properties), but not for the particular contact. I would like to have, for instance, visible in GroupByContacts view, one contact with specific work time start/end hours, while the rest use the timetables WorkTimeStartHour and WorkTimeEndHour. Is there any way that is possible? There does not seem to be a property like that for the contact.

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


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Set style for particular contact w/ GroupByCon
Reply #3 - Oct 28th, 2008 at 7:54am
Print Post  
There is no built-in way to achieve this. You will have to use custom drawing of the Timetable cells. In order to do this set the CustomDraw property of the Calendar class to CustomDrawElements.TimetableCell then handle the Calendar.Draw event. Then you can perform the necessary drawing depending on the time of the cell being drawn and the contact it is associated with.

Meppy
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint