Click here to Skip to main content
15,881,204 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
We have a datepicker control in our application which is actually drawn using a visual brush. Only when we click on the datepicker, a datepicker object is created. This datepicker class is inherited from the System::Windows::Controls::DatePicker and we have overridden the required functions.

The issue is when we click on the datepicker for the first time, the calendar does not stay open. It appears and suddenly disappears. Only on the second click it stays open. I tried setting the IsDropDownOpen property and also getting the PART_Popup to set the StaysOpen property, but both failed. Any help on this is welcome.
Posted
Updated 20-Nov-14 5:00am
v2
Comments
Sergey Alexandrovich Kryukov 20-Nov-14 11:39am    
All right, there can be too many ways to screw up things. How can we know which way have you chosen? :-)
—SA
Jlz07 21-Nov-14 5:29am    
umm..Should I explain more? I really can't find a workaround for this.
Jlz07 21-Nov-14 5:41am    
When a particular window is loaded, we draw a datepicker using a visual brush at a calculated position. As per requirement, the actual control should be created only when the datepicker is clicked. And so on the click, we have created the real datepicker object and have set the IsDropDownProperty to true. But this does not work as expected. The control is created alright, but the drop down does not stay open until the next click. This does not happen every time though. The control is drawn to a canvas(in the code behind of a WPF window).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900