This is a migrated thread and some comments may be shown as answers.

Load Current Date on Double Click

2 Answers 89 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 01 Jun 2011, 10:35 PM
I am trying to populate the current date in a RadDateTimePicker when I double click on the control, but while trying to override the OnMouseLeftButtonUp(Or down) the overriden event doesn't seem to be fired. 

protected override void  OnMouseLeftButtonUp(System.Windows.Input.MouseButtonEventArgs e)
{
     //Code to handle the double click here
}


Is there a way to accomplish loading the current date on a double click in the control?

2 Answers, 1 is accepted

Sort by
0
Accepted
Konstantina
Telerik team
answered on 03 Jun 2011, 12:26 PM
Hello David,

In order to achieve this you will need to create an attached property and handle the MouseClick there. Please find attached a sample project in which this is illustrated.

Hope this helps.

Best wishes,
Konstantina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
David
Top achievements
Rank 1
answered on 06 Jun 2011, 06:53 PM
Thanks for the help, that worked.  From your answer I also thought of adding a new event that would accomplish the same thing.
 
class DateEditor:RadDateTimePicker
    {
  
        public DateEditor()
        {
            AddHandler(MouseLeftButtonDownEvent, new MouseButtonEventHandler(NewMouseLeftButtonDown), true);
        }
  
        private void NewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            var dropDownDateEditorNew = sender as DropDownDateEditorNew;
  
            dropDownDateEditorNew.SelectedDate = DateTime.Now;              
        }
  
    }
Tags
DateTimePicker
Asked by
David
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
David
Top achievements
Rank 1
Share this question
or