RadCalendar SelectedDate is dropping the date?

2 posts, 0 answers
  1. eric
    eric avatar
    4 posts
    Member since:
    Apr 2011

    Posted 28 Mar 2012 Link to this post

    I'm using 2012 Q1.  On a very simple page I have a RadGrid and RadCalendar.  The RadGrid displays invoices for a certain day, and I have an ObjectDataSource with a ControlParameter using RadCalendar.SelectedDate as the SQL parameter.  On page load, I set the SelectedDate as today to set it for the first time.

    When I click around on dates, I'm often getting the error "SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM." I changed the code to add a RadButton, and call RadGrid.Rebind() on the click.  I also manually set the value of the parameter in the Selecting event.  What I noticed was the SelectedDate value was "#12:00:00 AM#", even though I clicked a date, and then clicked the RadButton.

    Clicking through the dates, if the RadGrid is empty due to no records, I'm able to keep navigating through.  However, if I load records from a date, the very next RadGrid.Rebind() is what triggers this error.

    Is there something I'm missing?
  2. eric
    eric avatar
    4 posts
    Member since:
    Apr 2011

    Posted 28 Mar 2012 Link to this post

    Problem Solved!  The master page had a RadNotification to alert users of messages, and there was an issue with viewState.  I had set ViewStateMode="Disabled" before, so I took that away and now I'm not receiving the error message.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top