예제 #1
0
 protected override RadElement CreateMainElement()
 {
     this.timePicker = new RadTimePickerContent();
     this.timePicker.TimePickerElement.TimeTables   = TimeTables.HoursAndMinutesInOneTable;
     this.timePicker.TimePickerElement.Step         = 30;
     this.timePicker.TimePickerElement.ColumnsCount = 6;
     return((RadElement) new RadHostItem((Control)this.timePicker));
 }
        private void CreateElements()
        {
            if (this.timePicker != null)
            {
                this.timePicker.CloseButtonClicked -= new EventHandler(this.timePicker_CloseButtonClicked);
                this.timePicker.ValueChanged       -= new EventHandler(this.timePicker_ValueChanged);
            }
            if (this.popupControl != null)
            {
                this.popupControl.Opened  -= new EventHandler(this.popupControl_Opened);
                this.popupControl.Closing -= new RadPopupClosingEventHandler(this.popupControl_Closing);
                this.popupControl.Closed  -= new RadPopupClosedEventHandler(this.popupControl_Closed);
            }
            if (this.ShowTimePicker)
            {
                this.panel                          = new RadPanel();
                this.calendar.Size                  = new Size(180, 150);
                this.calendar.Dock                  = DockStyle.Left;
                this.timePicker                     = new RadTimePickerContent();
                this.timePicker.ReadOnly            = this.Calendar.ReadOnly;
                this.timePicker.Culture             = this.textBoxElement.Culture;
                this.timePicker.CloseButtonClicked += new EventHandler(this.timePicker_CloseButtonClicked);
                this.timePicker.ValueChanged       += new EventHandler(this.timePicker_ValueChanged);
                this.timePicker.Dock                = DockStyle.Fill;
                if (this.showFooter)
                {
                    this.footerPanel      = new TimePickerDoneButtonContent(this.timePicker.TimePickerElement);
                    this.footerPanel.Dock = DockStyle.Bottom;
                }
                this.panel.Controls.Add((Control)this.timePicker);
                this.panel.Controls.Add((Control)this.calendar);
                if (this.showFooter)
                {
                    this.panel.Controls.Add((Control)this.footerPanel);
                }
            }
            this.popupControl               = new RadDateTimePickerDropDown((RadItem)this.dateTimePickerElement);
            this.popupControl.SizingMode    = SizingMode.UpDownAndRightBottom;
            this.popupControl.Opened       += new EventHandler(this.popupControl_Opened);
            this.popupControl.Closing      += new RadPopupClosingEventHandler(this.popupControl_Closing);
            this.popupControl.Closed       += new RadPopupClosedEventHandler(this.popupControl_Closed);
            this.popupControl.HostedControl = !this.ShowTimePicker ? (RadControl)this.calendar : (RadControl)this.panel;
            string themeName = this.Calendar.ThemeName;

            this.popupControl.ThemeName = themeName;
            if (this.ShowTimePicker && this.TimePicker != null)
            {
                this.panel.ThemeName      = themeName;
                this.TimePicker.ThemeName = themeName;
                if (this.ShowFooter)
                {
                    this.FooterPanel.ThemeName = themeName;
                }
            }
            this.popupControl.LoadElementTree();
        }
예제 #3
0
 protected override RadElement CreateMainElement()
 {
     this.calendar   = new RadCalendar();
     this.timePicker = new RadTimePickerContent();
     this.timePicker.TimePickerElement.TimeTables   = TimeTables.HoursAndMinutesInOneTable;
     this.timePicker.TimePickerElement.Step         = 30;
     this.timePicker.TimePickerElement.ColumnsCount = 6;
     this.pageView = new RadPageView();
     ((RadPageViewStripElement)this.pageView.ViewElement).ItemFitMode  = StripViewItemFitMode.Fill;
     ((RadPageViewStripElement)this.pageView.ViewElement).StripButtons = StripViewButtons.None;
     this.pageView.Pages.Add(new RadPageViewPage("Date"));
     this.pageView.Pages.Add(new RadPageViewPage("Time"));
     this.pageView.Pages[0].Item.TextAlignment = ContentAlignment.MiddleCenter;
     this.pageView.Pages[1].Item.TextAlignment = ContentAlignment.MiddleCenter;
     this.pageView.Pages[0].Controls.Add((Control)this.calendar);
     this.pageView.Pages[1].Controls.Add((Control)this.timePicker);
     this.calendar.Dock   = DockStyle.Fill;
     this.timePicker.Dock = DockStyle.Fill;
     return((RadElement) new RadHostItem((Control)this.pageView));
 }