Edit this page

How to create a select-only RadDateTimePicker

This tutorial shows you how to modify the default RadDateTimePicker in such a way that the user is not allowed to type in the control but only to choose from the drop down picker.

To do this you will have to slightly modify the template of your RadDateTimePicker control. You have to go through the following steps:

  • Generate the default RadDateTimePicker's template.

To see how to do this read here. You can also learn more about the RadDateTimePicker'sTemplate Structure.

  • Select the RadWatermarkTextBox called PART_DateTimeInput and set its IsReadOnly property to True.

This will achieve the desired behavior. However, a specific grey visual element will appear on the top of your RadDateTimePicker input box control. To remove it you will have to modify the default style used by the RadWatermarkTextBox control.

  • After generating the RadWatermarkTextBox's style in the Resources pane in Expression Blend you can find the ControlBackground_ReadOnly brush and set it to the RadDateTimePicker's background color.

Learn more about the RadWatermarkTextBox here.

See Also