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

Problem Setting SelectedDates collection

2 Answers 67 Views
Calendar, DateTimePicker, TimePicker and Clock
This is a migrated thread and some comments may be shown as answers.
Kerry
Top achievements
Rank 1
Kerry asked on 15 Feb 2012, 03:52 PM
Hello, 

I'm using a RadCalendar within my WinForms application, I'm having an issue setting the SelectedDates collections programmatically. The code below works only if I uncomment the statement dtDate = new DateTime(dtDate.Year, dtDate.Month, dtDate.Day);   It sets the dates and highlights them correctly when I have multiple dates. If I do not create an instance of a DateTime object as you see below the calendar seems to only accept the first date in my dataset.  This is odd since the DateTime.TryParse statement returns a valid datetime into dtDate variable and I feel its unnecessary to have to set it again.  Using VS2008 Framework 3.5 build 2011.3.11.1116.

DateTime dtDate;
foreach (DataRow rw in oDS.Tables[0].Rows)
 {
        DateTime.TryParse(rw["eDate"].ToString(), out dtDate);
       //dtDate = new DateTime(dtDate.Year, dtDate.Month, dtDate.Day);
        radCalendar1.SelectedDates.Add(dtDate);
}

Thanks Kerry

2 Answers, 1 is accepted

Sort by
0
Boryana
Telerik team
answered on 20 Feb 2012, 09:53 AM
Hello Kerry,

Your question has already been answered in the other forum thread you have opened. Please see our answer there. 

You are not able to see your first forum thread, because it has been transferred to our support ticketing system and therefore is no longer public. This step is needed since we have asked you for a sample project that reproduces the issue.

We kindly ask you to use just one support channel to contact us. Posting the same questions several times slows down our response time. Please note that threads are handled according to license and time of posting, so if it is an urgent problem, we suggest you use a support ticket, which would be handled before a forum thread.

Thank you for your understanding and cooperation.

Regards,
Boryana
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Kerry
Top achievements
Rank 1
answered on 20 Feb 2012, 05:17 PM
Sorry not sure how this happened, I only posted it once but I received an error and had to refresh the page and it must have posted the msg again.

Kerry
Tags
Calendar, DateTimePicker, TimePicker and Clock
Asked by
Kerry
Top achievements
Rank 1
Answers by
Boryana
Telerik team
Kerry
Top achievements
Rank 1
Share this question
or