Пример #1
0
        public override bool EndEdit()
        {
            base.EndEdit();
            RadDateTimePickerElement editorElement  = (RadDateTimePickerElement)this.EditorElement;
            RadTextBoxElement        textBoxElement = (RadTextBoxElement)editorElement.TextBoxElement;

            editorElement.ValueChanging -= new ValueChangingEventHandler(this.RadDateTimeEditor_ValueChanging);
            editorElement.ValueChanged  -= new EventHandler(this.RadDateTimeEditor_ValueChanged);
            RadDateTimePickerCalendar currentBehavior = editorElement.GetCurrentBehavior() as RadDateTimePickerCalendar;

            if (currentBehavior != null)
            {
                currentBehavior.PopupControl.Opened -= new EventHandler(this.PopupControl_Opened);
                currentBehavior.PopupControl.Closed -= new RadPopupClosedEventHandler(this.PopupControl_Closed);
                currentBehavior.Calendar.CalendarElement.CalendarStatusElement.ClearButton.Click -= new EventHandler(this.ClearButton_Click);
                currentBehavior.Calendar.CalendarElement.CalendarStatusElement.TodayButton.Click -= new EventHandler(this.TodayButton_Click);
            }
            if (textBoxElement != null)
            {
                textBoxElement.KeyDown -= new KeyEventHandler(this.TextBoxElement_KeyDown);
                textBoxElement.KeyUp   -= new KeyEventHandler(this.textBoxElement_KeyUp);
            }
            (editorElement.GetCurrentBehavior() as RadDateTimePickerCalendar)?.PopupControl.Hide();
            return(true);
        }
Пример #2
0
        public override bool EndEdit()
        {
            base.EndEdit();
            RadDateTimePickerElement editor         = (RadDateTimePickerElement)this.EditorElement;
            RadTextBoxElement        textBoxElement = editor.TextBoxElement;

            editor.ValueChanging -= new ValueChangingEventHandler(RadDateTimeEditor_ValueChanging);
            editor.ValueChanged  -= new EventHandler(RadDateTimeEditor_ValueChanged);
            RadDateTimePickerCalendar dateTimeBehavior = editor.GetCurrentBehavior() as RadDateTimePickerCalendar;

            if (dateTimeBehavior != null)
            {
                dateTimeBehavior.PopupControl.Opened -= new EventHandler(PopupControl_Opened);
                dateTimeBehavior.PopupControl.Closed -= new RadPopupClosedEventHandler(PopupControl_Closed);
                dateTimeBehavior.Calendar.CalendarElement.CalendarStatusElement.ClearButton.Click -= new EventHandler(ClearButton_Click);
                dateTimeBehavior.Calendar.CalendarElement.CalendarStatusElement.TodayButton.Click -= new EventHandler(TodayButton_Click);
            }
            if (textBoxElement != null)
            {
                textBoxElement.KeyDown -= new KeyEventHandler(TextBoxElement_KeyDown);
                textBoxElement.TextBoxItem.HostedControl.LostFocus -= new EventHandler(HostedControl_LostFocus);
            }
            RadDateTimePickerCalendar calendar = editor.GetCurrentBehavior() as RadDateTimePickerCalendar;

            if (calendar != null)
            {
                calendar.PopupControl.Hide();
            }
            return(true);
        }
Пример #3
0
        private void PopupControl_Opened(object sender, EventArgs e)
        {
            RadDateTimePickerElement  dateTimePicker         = this.EditorElement as RadDateTimePickerElement;
            RadDateTimePickerCalendar dateTimePickerCalendar = dateTimePicker.GetCurrentBehavior() as RadDateTimePickerCalendar;

            if (dateTimePickerCalendar != null)
            {
                dateTimePickerCalendar.Calendar.SelectedDates.Clear();
                dateTimePickerCalendar.Calendar.InvalidateCalendar();
            }
        }