This project has moved and is read-only. For the latest updates, please go here.

DateTimePicker throws NullReferenceException

Jun 29, 2016 at 10:13 AM
Edited Jun 29, 2016 at 10:15 AM
Hello,

I'm using the DateTimePicker and modified some ControlTemplates to adjust the look. Now I get this error, when opening the calendar, and then set the focus into the textbox and press any key:

System.NullReferenceException: Object reference not set to an instance of an object.
at Xceed.Wpf.Toolkit.dateTimePicker.HandleKeyDown(...)

I just updated from 2.5 to 2.9, but it still happens. Is it possible that I removed a named template part that is not found anymore? Why it only happens with open popup? I modified the StaysOpen, because I want to click the togglebutton to close it, could be that it works without this modification, because the popup closes before. Where do I find the pdb file to be able to debug in detail?

Thanks for any help, Michael
Jun 29, 2016 at 10:22 AM
OK, I found it out by myself: the TimePicker was named "Part_TimeUpDown", but it has to be named "PART_TimeUpDown". My proposal: As it could always happens that anyone is re-templating this control, the code inside the control always has to check agains null when retrieving template parts.
Developer
Jun 29, 2016 at 1:10 PM
Thanks,

All controls will be reviewed.