This is a migrated thread and some comments may be shown as answers.

RadCalendar Default value?

4 Answers 115 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Wolfshund
Top achievements
Rank 2
Wolfshund asked on 18 Oct 2012, 02:52 PM
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

4 Answers, 1 is accepted

Sort by
0
Accepted
Todor
Telerik team
answered on 22 Oct 2012, 12:25 PM
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.

0
Wolfshund
Top achievements
Rank 2
answered on 26 Oct 2012, 01:57 AM
Hi Todor,
thank you very much for your kind help. I got it to work!

Joerg

0
Anish
Top achievements
Rank 1
answered on 17 May 2014, 08:49 PM
Is there a way to revert this. To make the selectedValue to default.
Or to deselect the current selection???
0
Todor
Telerik team
answered on 20 May 2014, 06:49 AM
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.

 
Tags
Calendar
Asked by
Wolfshund
Top achievements
Rank 2
Answers by
Todor
Telerik team
Wolfshund
Top achievements
Rank 2
Anish
Top achievements
Rank 1
Share this question
or