Rank: Newbie Groups: Member
Joined: 5/15/2009 Posts: 3
|
Hi support
I am trying to draw a box around a specific date which has been selected from a database. I have looked at the scheduling example and have got the dates correct but am having trouble with the drawing the box (all I am getting is a red bar under the day). Can you advise?
Here is what I have so far:
Thank you.
Protected Sub dpDates_DayRender(ByVal sender As Object, ByVal e As EO.Web.DayRenderEventArgs) Handles dpDates.DayRender
e.Writer.Write(e.Day.DayNumberText)
Dim DataDate As DateTime
If Not ds Is Nothing Then For Each dr As DataRow In ds.Tables(0).Rows DataDate = CType(dr("Mikron" & ddlMachine.SelectedValue & "_Date_Value"), DateTime)
If DataDate = e.Day.Date Then e.Writer.Write("<table border=""0"" cellSpacing=""0"" cellPadding=""0"">")
'Draw box around the day e.Writer.Write("<td colspan=""1"" align=""center"" height=""10""><div style=""width:16px;height:10px;overflow:hidden;background-color:red;"">")
e.Writer.Write(DataDate) e.Writer.Write("</div></td>")
e.Writer.Write("</tr></table>")
End If Next End If
End Sub
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
You code looks fine to us. You can replace your DataDate with a fixed string such as "test" and then write that out. That should tell you whether it has to do with your DataDate or something else.
Also, you don't need to use a table at all. Just put a single DIV should be enough to get the background color for you. You may want to adjust the DIV's size to see the result.
Thanks!
|