Setting selected dates in code

5 posts, 0 answers
  1. Thorgeir
    Thorgeir avatar
    1 posts
    Member since:
    Sep 2008

    Posted 10 Sep 2008 Link to this post

    Hi
    How can I set selected dates in code?

    - Thorgeir
  2. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 11 Sep 2008 Link to this post

    Hi Thorgeir,

    If you are in SelectionMode=Single you can set selected date using calendar's SelectedDate property like:
    RadCalendar calendar = new RadCalendar();  
    calendar.SelectionMode = SelectionMode.Single;  
    calendar.SelectedDate = new DateTime(2008, 7, 7); 

    For other SelectionModes (Multiple and Extended) you should use the calendar's SelectedDates property like:
    RadCalendar calendar = new RadCalendar();  
    calendar.SelectionMode = SelectionMode.Extended;  
    calendar.SelectedDates.Add(new DateTime(2008, 7, 7));  
    calendar.SelectedDates.Add(new DateTime(2008, 7, 8));  
    calendar.SelectedDates.Add(new DateTime(2008, 10, 10)); 

    If you have other questions, we will be glad to help.


    Sincerely yours,
    Hristo
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft banner
  4. Prakash
    Prakash avatar
    14 posts
    Member since:
    Aug 2009

    Posted 24 Aug 2009 Link to this post

    Control Name : RadDatePicker
    Environment   : SilverLight with C#
    Issue               : Currently datepicker control in my application date displays format taking from my machine regional date setting format.
                             How can i change customizes date format in raddatepicker control
                             Please help
  5. Prakash
    Prakash avatar
    14 posts
    Member since:
    Aug 2009

    Posted 24 Aug 2009 Link to this post

    Control Name : RadDatePicker
    Environment   : SilverLight with C#
    Issue               : Currently datepicker control in my application date displays format taking from my machine regional date setting format.
                             How can i change customizes date format in raddatepicker control
                             Please help
  6. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 25 Aug 2009 Link to this post

    Hi Chennai MGL,

    You should use the Culture property of RadDatePicker to customize the date format.

    Kind regards,
    Valeri Hristov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top
DevCraft banner