Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calendar Control

Status
Not open for further replies.

barrykellett

Programmer
Mar 4, 2003
29
GB
Hi all - I want to have a calendar control on my webpage that will access an MS Access database with minimum data and change the colour of cells that have events on that day.

I know I need to use the DayRender event, but I am absolutely clueless how to do this
happy.gif
, can anyone help?

Ultimately I want to bind the details of the event from the database to some text for each day, but if someone can show me how to actually use the DayRender to step through the database and change the cell colour I would be very very grateful!

PS I am coding in VB.NET
 
This little piece of code gives a red background to the date 2 days in the future. I am sure you should be able to use it to do what your trying to do.

Private Sub Calendar1_DayRender(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DayRenderEventArgs) Handles Calendar1.DayRender
If e.Day.Date = Date.Now.AddDays(2).Date Then
e.Cell.BackColor = Drawing.Color.Red
End If
End Sub
That'l do donkey, that'l do
[bravo] Mark
If you are unsure of forum etiquette check here faq796-2540
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top