Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2008-10-05
3
Medium Priority
?
278 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

721 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