We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How use property SelectedDays?

I am trying to programmatically manipulate "SelectedDates" property, but changes in the collection does not affect the visual display.

How use property SelectedDays?

5 Replies

PB Priyanga Balasubramaniam Syncfusion Team August 9, 2016 10:02 AM UTC

Hi Berezkin,

Thank you for contacting Syncfusion Support.

We have checked your query and created a sample. In this sample, we have selected the multiple dates by adding dates to "SelectedDates" property in button click event.

Please download the sample from the below location.

Sample: CalendarEditSample

Regards,
Priyanga B


BG Berezkin Gena August 9, 2016 03:00 PM UTC

Thank you!

Your example has helped detect problems in my code. I found a problem that can not be solved. The attached file contains an example that will help you understand the problem.
To reproduce the problem you need to:
1. Start project;
2. Select a date that differs from the current date;
3. Repeatedly pressing the "<" or ">" button.

The number of days selected in the GUI and collection is different.

Attachment: CalendarEditSample_81ccb9f2.rar


PB Priyanga Balasubramaniam Syncfusion Team August 10, 2016 12:07 PM UTC

Hi Berezkin,

We have checked your query and sample. You have used "SelectedDates.Clear()" in Button click event. This only clears the SelectedDates collection. The value in the Date property will not be cleared because minimum one date should be selected in the calendar, this is behavior.

We have changed your last updated sample to meet your requirement. In this sample we have added date to SelectedDates collection and also changed the value of Date property.

Please download the sample from the below location.

Sample:CalendarEditSample

Regards,
Priyanga B.


BG Berezkin Gena August 11, 2016 11:14 AM UTC

Thank you, it works.

How can I select two dates from different months?
For example, on June 6 and 6 August. Is that possible?


PB Priyanga Balasubramaniam Syncfusion Team August 12, 2016 11:13 AM UTC

Hi Berezkin,

Thank you for the update.

In our current implementation of CalendarEdit control, we can add date’s from two different months to SelectedDates collection. But in UI while clicking the MonthNavigation buttons (Right and Left arrows) SelectedDates collection will be reset to first date of current month and selected date of month will be first date of current month. This is the behavior of CalendarEdit control.

Please provide us more information about your requirement to analyze and provide you a solution.

Regards,
Priyanga B


Loader.
Up arrow icon