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

RadCalendar SelectedDate is dropping the date?

1 Answer 62 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
eric
Top achievements
Rank 1
eric asked on 28 Mar 2012, 07:23 PM
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?

1 Answer, 1 is accepted

Sort by
0
eric
Top achievements
Rank 1
answered on 28 Mar 2012, 07:44 PM
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.
Tags
Calendar
Asked by
eric
Top achievements
Rank 1
Answers by
eric
Top achievements
Rank 1
Share this question
or