RadDatePicker setmaxtime confusing stack trace

1 posts, 0 answers
  1. Brian
    Brian avatar
    1 posts
    Member since:
    Jan 2018

    Posted 11 Jan 2018 Link to this post

    So I have a a RadDatePicker declared thus: 

     

    protected global::Telerik.Web.UI.RadDatePicker rdpEndDT;

     

    And I am using it in code thus: 

     

                        rdpEndDT.SelectedDate = // some date;
                        rdpEndDT.MinDate = // some other date.;
                        rdpEndDT.MaxDate = // yet another date;

     

    I have a stack trace error of the following form: 

     

    Cause: ArgumentOutOfRangeException 
    Cause Description: Value of '1/10/2018 12:00:00 AM' is not valid for 'SelectedDate'. 'SelectedDate' should be between 'MinDate' and 'MaxDate'. 
    Parameter name: SelectedDate 
    Cause Stack: 
    at Telerik.Web.UI.RadDatePicker.set_SelectedDate(Nullable`1 value) 
    at Telerik.Web.UI.RadDatePicker.set_MaxDate(DateTime value) 

     

    What is this stack trace telling me? 

    Is the complaint on this line: 

      rdpEndDT.MaxDate = // yet another date;

    but if it is, given that I'm changing the max date, why should this exception be raised? At this point in the process max date is default of 2099; it is being set to a lower value in this code branch.  Why should max date refuse to permit itself to be changed?

    Or is the complaint on this line: 

     

    rdpEndDT.SelectedDate = some date

     

    which would occur if I was trying to programmatically set a selected date later than the max date. But if this is so, why is set_MaxDate mentioned in the stack trace? 

     

    Respectfully, 

     

    Brian P. 

     


Back to Top