unhandled exception when the same date is selected twice

Dec 27, 2010 at 3:42 AM

Hi, first of all, thank you for contributing this control.  I am starting a new project for which I needed a calendar control and this will be very helpful.

When I click a particular date say 12/3/2010 to select it and click on it again, the following exception gets thrown:

Value does not fall within the excepted range.

This is because the code is attempting to add an item with duplicate key in the dummy dictionary in the button click event for the date.

I just changed the code as follows:

            if (!_dummyRepository.ContainsKey(selectedDate.Date))
                _dummyRepository.Add(selectedDate.Date, "data");
Dec 27, 2010 at 10:06 PM

Thanks Pratik, for catching this error. I fixed the issue and is now available for download.