RadCalendar.IsValidFirstDayOfWeek - throw exception

2 posts, 0 answers
  1. ppti
    ppti avatar
    12 posts
    Member since:
    Dec 2010

    Posted 15 Feb 2011 Link to this post

     

     

     

    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!

  2. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 17 Feb 2011 Link to this post

    Hello ppti,

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

    Regards,
    Kaloyan
    the Telerik team
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top