public IEnumerable<object> Render(PanelItem panelItem) { var validator = SmartValidator.Create(panelItem.GetPropertyName()); var box = new SmartDateTextBox { ID = panelItem.GetId(), TextMode = TextBoxMode.SingleLine, Wrap = true, Enabled = panelItem.Editable, Width = new Unit(panelItem.Width, UnitType.Ex), FormatDisplay = DateFormat, CssClass = ItemStyle }; var calendar = new CalendarExtender { TargetControlID = box.UniqueID, Format = DateFormat, EnabledOnClient = panelItem.Editable }; var description = new Label { Width = new Unit(panelItem.Width, UnitType.Ex), Text = DateFormat, CssClass = ItemStyle }; panelItem.Target = calendar; return new object[] { box, validator, calendar, description }; }
public IEnumerable<object> Render(PanelItem panelItem) { var formatDisplay = DateFormat; var box = new SmartDateTextBox { ID = panelItem.GetId(), TextMode = TextBoxMode.SingleLine, Wrap = true, Enabled = panelItem.Editable, Width = new Unit(panelItem.Width, UnitType.Ex), FormatDisplay = formatDisplay, Visible = panelItem.Visible }; var calendar = new CalendarExtender { TargetControlID = box.UniqueID, Format = formatDisplay, EnabledOnClient = panelItem.Editable }; var description = new Label { Width = new Unit(panelItem.Width, UnitType.Ex), Text = string.Format("({0})", formatDisplay), Visible = panelItem.Visible }; if (panelItem.MaxLength > 0) box.MaxLength = panelItem.MaxLength; box .AddStyle(CssClass.Item) .AttachToolTip(panelItem) .ToggleStyle(panelItem.Editable, CssClass.Editable, CssClass.ReadOnly); description .AddStyle(CssClass.Item); panelItem.Target = box; return new List<Control> { box, PanelValidator.Create(panelItem), calendar, description }; }