Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
180
Changing Styles of Today
posted

Hi, I've been trying to style a calendar but I'm having issues getting the "Today" date square and header to stay "navy" when I select a different date, But <TodayHeaderStyle> and <TodayStyle> only works when "Today" is selected. Anyone that can help please let me know :))

  • 24497
    Suggested Answer
    posted

    Hi Fliteska,
    I could not find calendar control which has TodayHeaderStyle or TodayStyle. I assume that you use Infragistics.WebUI.WebCalendar control which has Layout.FooterStyle (area where Today button is displayed) and TodayDayStyle (today day in calendar).

    If you set custom value for FooterStyle.BackColor, then it should have effect, because by default background for that area is not set. However, if you need to set background color for the "today" day in calendar, then TodayDayStyle may have effect only when that date is not selected (or not hovered, if hover style has also background), due to merging with corresponding select/hover styles of day.
    It will be clear, if you look at generated html and check order of styles used by calendar. The BackColor of Style is converted to the css and rendered in dynamic <style> object, and selected/hover styles appear after today style. Otherwise, hover and selection would have lower priority and in case of conflicting attributes they would have no effect.

    If you need to permanently set style attribute, like background, for a specific area, then the only suggestion I have, is to use "!important" for that attribute. In this case it will have highest priority and will not depend on order of css with conficting attributes. Below is example.

    <head runat="server">
        <title></title>
        <style type="text/css">.blueBack{background:#4080e0 !important;}</style>
    </head>
    <body>
        <form id="form1" runat="server">
        <igsch:WebCalendar ID="WebCalendar1" runat="server">
       <Layout>
        <TodayDayStyle CssClass="blueBack"></TodayDayStyle>
        <FooterStyle BackColor="#4080e0" />
       </Layout>
      </igsch:WebCalendar>
        </form>
    </body>