public void datePickerDestroyed(object sender, EventArgs e)
        {
            this.Modal = true;
            this.deadLineTextArea.Text = datePicker.DatePicked.ToString(dateFormat);

            datePicker = null;
        }
        protected void OnDatePickerButtonClicked(object sender, EventArgs e)
        {
            if (datePicker == null)
            {
                if (string.IsNullOrEmpty(this.deadLineTextArea.Text))
                {
                    datePicker = new CalendarDatePickerDialog(DateTime.Now);
                }
                else
                {
                    datePicker = new CalendarDatePickerDialog(DateTime.Parse(this.deadLineTextArea.Text));
                }

                datePicker.Destroyed += new EventHandler(datePickerDestroyed);
                this.Modal            = false;
                datePicker.Modal      = true;
                datePicker.ShowAll();
            }
        }
        protected void OnDatePickerButtonClicked (object sender, EventArgs e)
        {
            if (datePicker == null) {               
                if (string.IsNullOrEmpty (this.deadLineTextArea.Text))
                    datePicker = new CalendarDatePickerDialog (DateTime.Now);
                else
                    datePicker = new CalendarDatePickerDialog (DateTime.Parse (this.deadLineTextArea.Text));

                datePicker.Destroyed += new EventHandler (datePickerDestroyed); 
                this.Modal = false;
                datePicker.Modal = true;
                datePicker.ShowAll (); 
            }
        }
        public void datePickerDestroyed (object sender, EventArgs e)
        { 
            this.Modal = true;
            this.deadLineTextArea.Text = datePicker.DatePicked.ToString (dateFormat);

            datePicker = null;
        }