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

Highlighting the current date when the control get focus

1 Answer 104 Views
DatePicker
This is a migrated thread and some comments may be shown as answers.
Lee
Top achievements
Rank 1
Lee asked on 01 Dec 2011, 03:45 PM
I have a user control with a RadDatePicker on it and set the focus to the picker when the control recieves focus.
This seems to work great except the existing date does not highlighted and has to be deleted chard by char before you can type a new one.

Is there any way to set focus and highlight the exsiting contents?

If I tab away and alt + tab back it does highlight the contents.

1 Answer, 1 is accepted

Sort by
0
Ivo
Telerik team
answered on 02 Dec 2011, 02:05 PM
Hi Lee,

The easiest way I found was to set custom control template to the RadDateTimePicker and attach to the GotFocus event of RadWatermarkTextbox. On GotFocus I called watermark.SelectAll and it worked. You can find an attached project demonstrating this.

Kind regards,
Ivo
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
DatePicker
Asked by
Lee
Top achievements
Rank 1
Answers by
Ivo
Telerik team
Share this question
or