on Mar 19, 2013
I realize this thread is quite old, but I am running into the same scenario that David experienced and I am hoping someone can shed some light.
Background: We have a period setting (Month/Year combination) that can be updated by a user. For example, if the setting was previously set to December, 2012 and it needs to be updated to January, 2013, the user should be able to view the existing period and update it. I was thinking of using the RadMonthYearPicker.
Problem: The issue I am running into is that in order for the RadMonthYearPicker to display the current period setting, I first have to set its "SelectedDate" property to the current period setting. I do this in the Page_Load event, but I have also tried it in the RadMonthYearPicker's Load event as well. However, when I do that, the OldDate and the NewDate values are the same in the SelectedDateChanged event even though the NewDate should be different after being updated.
If I do not set its "SelectedDate" property to the current period setting initially, the OldDate and the NewDate values differ and reflect the correct values in the SelectedDateChanged event. The problem, of course, is that the current value is not being displayed initially and I need it to be displayed.
<telerik:RadMonthYearPicker ID="rmyStartPeriod" runat="server" onselecteddatechanged="rmyStartPeriod_SelectedDateChanged">
protected void Page_Load(object sender, EventArgs e)
rmyStartPeriod.SelectedDate = DateTime.Parse("12/01/2012");
protected void rmyStartPeriod_SelectedDateChanged(object sender, Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs e)
DateTime oldDate = e.OldDate.Value;
DateTime newDate = e.NewDate.Value;
How can the RadMonthYearPicker control be set to a "initial/default" date without affecting the SelectedDateChanged functionality?