|
-
Jan 3rd, 2003, 04:24 PM
#2
Fanatic Member
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..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|