protected override void CreateChildControls() { if (Field == null) return; base.CreateChildControls(); if (ControlMode == SPControlMode.Display) return; TheDatePicker = (DateTimeControl)TemplateContainer.FindControl("TheDatePicker"); TheDatePicker.DateOnly = true; if (TheDatePicker.Equals(null)) { throw new ArgumentException("Corrupt DateTimeByMinuteTemplate - Date Missing"); } TheDatePicker.TabIndex = TabIndex; TheDatePicker.ToolTip = Field.Title + " Date"; DropDownHH = (DropDownList)TemplateContainer.FindControl("DropDownHH"); if (DropDownHH.Equals(null)) { throw new ArgumentException("Corrupt DateTimeByMinuteTemplate - HH Missing"); } DropDownHH.TabIndex = TabIndex; DropDownHH.CssClass = CssClass; DropDownHH.ToolTip = Field.Title + " Hour"; DropDownMM = (DropDownList)TemplateContainer.FindControl("DropDownMM"); if (DropDownMM.Equals(null)) { throw new ArgumentException("Corrupt DateTimeByMinuteTemplate - MM Missing"); } DropDownMM.TabIndex = TabIndex; DropDownMM.CssClass = CssClass; DropDownMM.ToolTip = Field.Title + " Minute"; if (ControlMode == SPControlMode.New) { DropDownHH.Text = Field.GetCustomProperty("DefaultHH").ToString(); DropDownMM.Text = Field.GetCustomProperty("DefaultMM").ToString(); } }