Welcome to Mediachase Community Sign in | Join | Help    
in Search   

Different color for Calendar Items

Last post Sun, Aug 17 2008, 11:50 PM by ga. 1 replies.
Sort Posts: Previous Next
  •  Fri, Aug 15 2008, 6:07 AM 10062

    Different color for Calendar Items

    How can I have different colors for the calendar Items?
    Example All my meetings should be Blue, All my LunchAppointment items should be Green, etc...
    I store EventType in my database and have access to it through CalendarExtensions
    EventType = 1 for meetings
    EventType = 2 for lunch etc..



  •  Sun, Aug 17 2008, 11:50 PM 10066 in reply to 10062

    Re: Different color for Calendar Items

    Hi,
    you should store additional information about calendar item in its property "Extensions".
    You can easily set items color with help of item template and item mapping properties.
    For instance you can define your item color in method "LoadItems" of web-service and assign its string value to "Extensions" property of calendar item:

    item.Extensions = ColorTranslator.ToHtml(MyColor);

    In this case in your item mapping element like this must be present:

    ..., {\"id\":\"myContainer\", \"property\":\"style.backgroundColor\", \"value\":\"Extensions\"},...

    You can create your own extension object with public properties "BgColor" and "ForeColor" and assign it to "Extentions" property of calendar item.

    BgColor will contain string color of item. ForeColor will contain string item font color. In this case your item mapping will contain the following elements:

    ...{\"id\":\"myContainer\", \"property\":\"style.backgroundColor\", \"value\":\"Extensions.BgColor\"},{\"id\":\"myContainer\", \"property\":\"style.color\", \"value\":\"Extensions.ForeColor\"}...

    Hope this helps.

View as RSS news feed in XML
Site Terms | Privacy Policy | About Us | Contact Us
Running on Mediachase eCommerce Framework 4.0.
  Copyright © Mediachase, LTD. 1997-2006. All Rights Reserved

E-commerce, HelpDesk, Service Desk & Project Management Software, alternatives to Microsoft Project Server & Sharepoint Collaboration Server
project management software | microsoft project server | sharepoint collaboration server | issues management, helpdesk & service desk
Powered by Community Server, by Telligent Systems