Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2008-10-05
3
Medium Priority
?
280 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 1000 total points
ID: 22647947
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
 

Author Closing Comment

by:dzumwalt
ID: 31503304
Perfect! Thats exactly what I neeed. Thanks.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Suggested Courses

926 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