2 posts, 1 answers
  1. Oleg
    Oleg avatar
    42 posts
    Member since:
    Oct 2011

    Posted 08 May 2012 Link to this post

    How can I get the current selected text of the DateTimePicker? Not the Date or CurrentDateText - just the mouse selection. Like the TextBox.SelectedText.


  2. Answer
    Ivo avatar
    390 posts

    Posted 09 May 2012 Link to this post


    The best way to achieve this would be to inherit from the RadDateTimePicker control and to get the TextBox part of the control. Then you will be able to use its SelectedText property. Here is sample code:
    public class DateTimePicker : RadDateTimePicker
        private TextBox textBoxPart;
        public override void OnApplyTemplate()
            this.textBoxPart = (TextBox)this.GetTemplateChild("PART_DateTimeInput");
        public string SelectedText
                return this.textBoxPart.SelectedText;

    You can find a sample project attached.

    Kind regards, Ivo
    the Telerik team

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

  3. DevCraft R3 2016 release webinar banner
Back to Top