RadCalendar Default value?

5 posts, 1 answers
  1. Wolfshund
    Wolfshund avatar
    50 posts
    Member since:
    Feb 2007

    Posted 18 Oct 2012 Link to this post

    Hi

    I want to ask what is the RadCalendar's default value when open/displayed for first time? In my expense app, I'm displaying a RadCalendar on the main page filled with expense data. At that time, RadCalendar.SelectedValue.Value is not set (it is NULL), so I want do assign the default value or if possible the RadCalender.Display.Value which is always the actual date I think.
    How can I check the RadCalendar's selected value for NULL and set it to the default/display date?
    Thank you very much.

    Kind regards,
    Joerg

  2. Answer
    Todor
    Admin
    Todor avatar
    778 posts

    Posted 22 Oct 2012 Link to this post

    Hello Joerg,

    Thank you for contacting us.

    Yes, the default value for SelectedValue is null. It is a normal DependencyProperty which you can set to whatever date you want, in XAML:
    <telerikInput:RadCalendar x:Name="calendar" SelectedValue="2012/10/25"/>
    or in code-behind:
    calendar.SelectedValue = DateTime.Today.AddDays(3);

    The display value is used for displaying the correct month, so its default value is the first day of the current month. If you change it, this will cause the calendar to display a different month.

    I hope this information helps.

    Kind regards,
    Todor
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Wolfshund
    Wolfshund avatar
    50 posts
    Member since:
    Feb 2007

    Posted 25 Oct 2012 Link to this post

    Hi Todor,
    thank you very much for your kind help. I got it to work!

    Joerg

  5. Anish
    Anish avatar
    1 posts
    Member since:
    Dec 2013

    Posted 17 May 2014 Link to this post

    Is there a way to revert this. To make the selectedValue to default.
    Or to deselect the current selection???
  6. Todor
    Admin
    Todor avatar
    778 posts

    Posted 20 May 2014 Link to this post

    Hello,

    You can set it to null:

    calendar.SelectedValue = null;

    Let me know if you need further assistance.

    Regards,
    Todor
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top
DevCraft banner