Solved

How to annotate multiple days on an asp.net calendar control.

Posted on 2008-10-05
3
259 Views
Last Modified: 2010-05-18
I am trying to use a calendar control in an asp.net project. I have a situation where during the course of a month,  there may be several events that are happening, and I would like to make the days when those events are occuring to show in a different color on the calendar control.

How is this done?
0
Comment
Question by:dzumwalt
3 Comments
 
LVL 16

Accepted Solution

by:
GreymanMSC earned 250 total points
Comment Utility
You need to implement the calendar's DayRender event, accessing the Cell container from the EventArgs and comparing it to your list of dates.

Something like this:
Protected Sub Calendar1_DayRender( _

    ByVal sender As Object, _

    ByVal e As System.Web.UI.WebControls.DayRenderEventArgs _

) Handles Calendar1.DayRender
 

    For Each dItem As Date in m_Dates

       If e.Day.Date.Equals(dItem) Then

          e.Cell.BackColor=Drawing.Color.Cyan

          Exit For

       End If

    End If
 

End Sub

Open in new window

0
 
LVL 6

Expert Comment

by:avnish_tanna
Comment Utility
0
 

Author Closing Comment

by:dzumwalt
Comment Utility
Perfect! Thats exactly what I neeed. Thanks.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now