Datepicker Watermark

by Sottje 1. April 2010 07:10
On my current project, we make use of the WPF Toolkit. One of the things we use is the Datepicker. A nice usefull control. We wanted to set the watermark, but the control doesn't support setting the watermark with a public property and we didn't want to go into the control's source itself.
On Codeplex, we found a forum topic with a solution (thnx Spud). Derive from the Datepicker control and override the OnRender method. This works and sets the watermark correctly.


But after a date is selected, the value was cleared and the control loses the focus, the default watermark returns again. I fixed this by using the LostFocus event on the textbox. [More]

Tags: , , , ,

Professional | c# | WPF