Highlighting the current date when the control get focus

2 posts, 0 answers
  1. Lee
    Lee avatar
    1 posts
    Member since:
    May 2011

    Posted 01 Dec 2011 Link to this post

    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.
  2. Ivo
    Ivo avatar
    390 posts

    Posted 02 Dec 2011 Link to this post

    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,
    the Telerik team

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

Back to Top