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

About me

Jeroen van Gent is a Professional Web, Windows and Surface developer at Qurius.

Currently coordinating 3rd line international support for an accounting company active in over a 100 countries for a WPF/Groove .NET application used by more than 20.000 users on a daily basis.

Husband and Parent with passion for Reading, Star Wars and Lego!

Follow me on twitter: