Welcome Guest Search | Active Topics | Sign In | Register

DatePicker created in codebehind with FooterTemplate Options
Ali M
Posted: Friday, May 22, 2009 2:14:58 PM
Rank: Newbie
Groups: Member

Joined: 9/10/2008
Posts: 5
Hi, I am trying to dynamically create multiple DatePicker fields on my form in the Page's OnLoad event and all works fine except for the FooterTemplate part where I want the Today section appears - just like the provided Windows_Multi_Month template. The Calendar appears correctly but not the footer section; not there at all. What am I doing wrong?
Thanks for any help.
Ali M.

Here is my code (some variable declarations omitted in code sample):

Code: Visual Basic.NET
Dim d As EO.Web.DatePicker = Nothing
            sID = "__ctl_" + "10"
            d = New EO.Web.DatePicker()
            d.EnableViewState = True
            d.ID = sID
            d.Style.Add("position", "absolute")
            d.Style.Add("top", sCTop)
            d.Style.Add("left", sCLeft)
            d.Style.Add("width", sCWidth)
            d.CssClass = "ft fd" 
            d.Enabled = True
            d.Attributes.Add("fqfieldname", sName)
            d.Attributes.Add("fieldprompt", sPrompt)
            d.Attributes.Add("fieldtype", "date")

            Dim _div As HtmlGenericControl = New HtmlControls.HtmlGenericControl("div")
            _div.Style.Value = "font-weight: bold; font-size: 11px; font-family: Tahoma""
            Dim _img As HtmlImage = New HtmlImage()
            _img.Src = "{img:00040106}"
            _div.Controls.Add(_img)
            _div.InnerHtml = "Today: {var:today:MM/dd/yyyy}"
            Dim f As EO.Web.ClientTemplate = New EO.Web.ClientTemplate()
            f.Controls.Add(_div)
            d.FooterTemplate = f

            d.SkinID = ""
            d.DayCellHeight = 16
            d.DayCellWidth = 22
            d.DayHeaderFormat = DayNameFormat.Short
            d.DisabledDates = New EO.Web.DateCollection()
            d.MonthColumns = 2
            d.MonthRows = 2
            d.MonthSelectorVisible = True
            d.SelectedDates = New EO.Web.DateCollection()
            d.TitleLeftArrowDownImageUrl = "00040103"
            d.TitleLeftArrowImageUrl = "00040101"
            d.TitleRightArrowDownImageUrl = "00040104"
            d.TitleRightArrowImageUrl = "00040102"
            d.VisibleDate = Date.Parse("2009-05-01")
            d.WeekSelectorVisible = True
            d.TodayStyle.CssText = "background-image:url('00040106');"
            d.SelectedDayStyle.CssText = "FONT-SIZE: 8pt; FONT-FAMILY: Tahoma; background-image:url('00040105');color:white;"
            d.DisabledDayStyle.CssText = "FONT-SIZE: 8pt; FONT-FAMILY: Tahoma; COLOR: gray"
            d.CalendarStyle.CssText = "border-bottom-color:Black;border-bottom-style:solid;border-bottom-width:1px;border-left-color:Black;border-left-style:solid;border-left-width:1px;border-right-color:Black;border-right-style:solid;border-right-width:1px;border-top-color:Black;border-top-style:solid;border-top-width:1px;padding-bottom:5px;padding-left:5px;padding-right:5px;padding-top:5px;background-color:white"
            d.DayHoverStyle.CssText = "FONT-SIZE: 8pt; FONT-FAMILY: Tahoma; text-decoration:underline"
            d.MonthStyle.CssText = "MARGIN: 0px 4px; cursor:hand"
            d.TitleStyle.CssText = "PADDING-RIGHT: 3px; PADDING-LEFT: 3px; FONT-WEIGHT: bold; FONT-SIZE: 8pt; PADDING-BOTTOM: 3px; COLOR: white; PADDING-TOP: 3px; FONT-FAMILY: Tahoma; BACKGROUND-COLOR: #0054e3"
            d.DayHeaderStyle.CssText = "FONT-SIZE: 11px; COLOR: #0054e3; BORDER-BOTTOM: black 1px solid; FONT-FAMILY: Tahoma"
            d.DayStyle.CssText = "FONT-SIZE: 8pt; FONT-FAMILY: Tahoma; text-decoration:none"

            pnl.Controls.Add(d)
eo_support
Posted: Friday, May 22, 2009 2:24:20 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

I believe it should be something like this:

Code: Visual Basic.NET
Dim f As EO.Web.ClientTemplate = New EO.Web.ClientTemplate()
f.Text = "... {img:00040106} ...."


Thanks!
Ali M
Posted: Friday, May 22, 2009 2:50:05 PM
Rank: Newbie
Groups: Member

Joined: 9/10/2008
Posts: 5
That worked, I didn't see the Text property :-)
Thanks for the quick response...

AM
eo_support
Posted: Friday, May 22, 2009 3:00:16 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
You are welcome. Glad it works for you!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.