Disabling raddatepicker

5 posts, 1 answers
  1. jonathan
    jonathan avatar
    23 posts
    Member since:
    Jun 2008

    Posted 25 Sep 2008 Link to this post

    Hi,

    my goal is:
    disable the text input so that users can't type anything in the date input.
    and i want to have a white background on the date input

    so far, i was able to disable the date input, but the text field is greyed.
    MyDatePicker.DateInput.Enabled = false;

    please help,
    Regards,
    Jonathan
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 26 Sep 2008 Link to this post

    Hi Jonathan,

    Try the following line of code to set the Disabled style for a RadDatePicker.

    CS:
     RadDatePicker3.DateInput.DisabledStyle.BackColor = System.Drawing.Color.White; 
             


    Thanks
    Shinu.
  3. jonathan
    jonathan avatar
    23 posts
    Member since:
    Jun 2008

    Posted 26 Sep 2008 Link to this post

    it works perfectly.

    thanks,
    Jonathan
  4. jonathan
    jonathan avatar
    23 posts
    Member since:
    Jun 2008

    Posted 26 Sep 2008 Link to this post

    hi, i have a follow-up question, when using get_selectedDate()

    the return is: Mon Sep 1 00:00:00 UTC+0800 2008

    but i don't need any of the other information except the Month, Day and Year.

    Regards,
    Jonathan
  5. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 29 Sep 2008 Link to this post

    Hi Jonathan,

    Try out the following JavaScript code to achieve the desired scenario.

    JS:
      <script type="text/javascript" > 
        function OnDateSelected(sender, eventArgs) 
        { 
        var date = sender.get_selectedDate().toLocaleDateString(); 
        alert(date) 
        } 
     </script> 


    Cheers
    Shinu.
Back to Top