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

RadCalendar.IsValidFirstDayOfWeek - throw exception

1 Answer 45 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
ppti
Top achievements
Rank 1
ppti asked on 15 Feb 2011, 06:28 AM

 

 

 

RadCalendar c = new RadCalendar();
c.FirstDayOfWeek = null;

See the method (RadCalendar.):

private static bool IsValidFirstDayOfWeek(object value)
{
    DayOfWeek? nullable = (DayOfWeek?) value;
    return (Enum.IsDefined(typeof(DayOfWeek), nullable) || !nullable.HasValue); // ???
}

I getting "throw ArgumentNullException: Value cannot be null.Parameter name: value"

Maybe code change to:

private static bool IsValidFirstDayOfWeek(object value)
{
    DayOfWeek? nullable = (DayOfWeek?) value;
    return (!nullable.HasValue || Enum.IsDefined(typeof(DayOfWeek), nullable.Value));
}

Its really working without exceptions!

1 Answer, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 17 Feb 2011, 03:41 PM
Hello ppti,

We will fix the issue shortly. Thank you for bringing to our attention.

Regards,
Kaloyan
the Telerik team
Tags
Calendar
Asked by
ppti
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Share this question
or