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

Leave Invalid Value in in DatePicker

1 Answer 49 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Robert Staniskis
Top achievements
Rank 1
Robert Staniskis asked on 15 Apr 2011, 12:46 AM
Hello,

I have a requirement for date controls to leave the invalid date in the textbox instead of blanking it out.  As an example, if there user were to type "abc" into a DatePicker control, the control needs leave the text in the box.  I am running my own custom validation routines so I notify the user that the value is invalid on my own.  Can you tell me how to leave the text in the DatePicker textbox even if the value is not a valid date?

Thanks for your help and awesome controls!

Robert

1 Answer, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 19 Apr 2011, 01:39 PM
Hello Robert,

To achieve the desired behaviour you will have to edit the template of the DatePicker. You can easily do this using Expression Blend. Just drop a DatePicker control into the design surface, right-click it and choose from the menu Edit Template->Edit a Copy. Then Blend will generate all the needed resources. Find the WatermarkTextBlock and remove the Text binding.
Please find attached a sample project in which the above-mentioned steps are performed.

Regards,
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
Tags
DatePicker
Asked by
Robert Staniskis
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Share this question
or