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
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