I'm using the Q3 2008 version of the RadCalendar control and am facing multiple issues:
* Set the Max, Min Date and Selected dates on load and populate a grid based on the selected date -- works fine.
* Change the selected date on the datepicker using the popup -- grid is refreshed ok with data for new date
* When I enter an invalid date, it execute the js function handling the OnError *twice* as a result of which the alert is popped up twice to the user.
* After handling the validation error using OnError, when I enter a valid date and hit enter it fires the SelectedDateChanged event but *not* if I use the popup. What can I do to ensure that the control is again in a valid state and the popup selection works?
NOTE: I'm using the RadAjaxManager to update the grid data based on the date selection made
Thanks
Snippets enclosed:
<telerik:RadDatePicker ID="MMDDatePicker"
runat="server"
Skin="Office2007"
Width="90px"
AutoPostBack="true">
<DateInput runat="server" ClientEvents-OnError="OnError"></DateInput>
</telerik:RadDatePicker>
function OnError(sender, args)
{
var datePicker = $find("<%= MMDDatePicker.ClientID %>");;
var date = datePicker.get_selectedDate();
alert(
'Invalid date or date is not with in available date range of ' +
datePicker.get_minDate().format(
"d") + ' and ' +
datePicker.get_maxDate().format(
"d") );
return false;
}