Is there a way to make the calendar control look like the Calendar in Outlook? :confused:
I'd like a way to add text to specific days.
Printable View
Is there a way to make the calendar control look like the Calendar in Outlook? :confused:
I'd like a way to add text to specific days.
VB Code:
Sub Calender1_RenderDay(ByVal s As Object, ByVal e As DayRenderEventArgs) Dim ctlCell As TableCell Dim strText As String strText = "Today is the 15th!" If e.Day = 15 Then ctlCell = e.Cell ctlCell.Controls.Add(New LiteralControl(strText)) End If End Sub
Take a look at that Event ... it fires each time it draws a day....
so, that code should write something on the 15th day...
From there, you can do other things.. for instance, i made a Calender of Events type thing, that put hyperlinks on each day and those linked to new pages with details of each event... you can easily rig something up to retrieve info from a dataset and put it in the right spots on the calender....
I was about to make a whole new calender when i stumbled upon this hidden capability of the normal Calender Control.. It sure is a lot easier than making it from scratch, or buying some 3rd party control. There are other events you can look at too to do other things... but this should get the ball rolling for you... btw, i didn't test that code, i just threw it together with my current knowledge.. don't shoot me if it doesn't work.. :D
Are you using the regular Microsoft Calendar Control? Because I don't see that event for the control... :confused: