Selecting already selected day sets SelectedDate to DateTime.MinValue
Thank you for contacting Syncfusion Support.
We have analyzed the reported issue by creating a simple sample. But we were unable to reproduce the issue at our end. In this sample we have used SfCalendar and 'Change SelectedDate' button to set the same SelectedDate value at run time. Can you please check whether you are able to reproduce the reported issue with this sample?
Please download the sample from the below link
Sample: SfCalendarsample
Could you please provide more details about your query by modifying the sample and replication steps to reproduce the issue? It will help us to proceed further.
Regards,
Venkateshwaran V.R.
Attachment: SfCalendarsample_921c33f7.zip
We have confirmed the reported issue "Selecting already selected day sets SelectedDate to DateTime.MinValue" as a defect. We will include this fix in our Vol 1, 2016 Service pack 1 release which will be available in April, 2016.
Regards,
Venkateshwaran V.R.
Hi James,
Please ignore the previous update.
We have modified your last updated sample to meet your requirement.
In this sample we have changed type of SelectedDate
in your view model as object.
The type of SelectedDate is object. So if we select the
already selected date the SelectedDate property return the null(default value
of object) value . But if we set SelectedDate as DateTime it will return its
default value(DateTime.Min) . Due to this reason the SelectedDate changed to
DateTime.Min. Please find the sample from the attached file.
Please let us know if the above sample meets your
requirements or not.
Note: If you want to maintain SelectedDate as DateTime.
Please skip the default value of DateTime before setting the SelectedDate property as
like in below code snippet.
|
set { if ((DateTime)value != DateTime.MinValue) { if (!_monthArrowPressed
&& !value.Equals(_selectedDate)) { Set(ref _selectedDate, value);
RaisePropertyChanged(() => DisplayFormattedDate); CalendarIsOpen = false;
_dateSelectedCommand.ExecuteAsync((DateTime)_selectedDate); } } |
Regards,
Rajkumar G
Attachment: SfCalendarsample_1bfb29ae.zip
- 4 Replies
- 3 Participants
-
JN James Newton King
- Mar 14, 2016 12:10 AM UTC
- Mar 18, 2016 01:31 PM UTC