I have searched these forums and haven't found a solution or mention of this yet, but if it's out there, feel free to point me in that direction.
Using Telerik.Web.UI, v.2011.2.915.40, .NET 4, and ASP.NET/C#, in Visual Studio 2010.
I have a RadDateInput and would like to use the MMM yyyy date format, and use mouse keys to change the date. This is the way the RadDateInput is configured:
However, on dates such as Sept. 30, 2011 when the day number (30th) is greater than the days in another month (for example, February 2011 only goes up to 28 days) then you can't use the mouse keys to change to or past that month. I have tried using the server side OnTextChanged for the RadDateInput to manually set the day to the 1st of the month at that time, but that didn't work. Setting an initial value in the RadDateInput using the current date and changing the day to the 1st also did not work for me. I've also tried using javascript on the client OnValueChanging event to re-enter the value with the day of 01, but that didn't work either. The javascript solution I tried:
Is there something I'm missing? or is this an issue with the RadDateInput control itself?
Using Telerik.Web.UI, v.2011.2.915.40, .NET 4, and ASP.NET/C#, in Visual Studio 2010.
I have a RadDateInput and would like to use the MMM yyyy date format, and use mouse keys to change the date. This is the way the RadDateInput is configured:
<
telerik:RadDateInput
runat
=
"server"
ID
=
"rdiDate"
DateFormat
=
"MMM yyyy"
DisplayDateFormat
=
"MMM yyyy"
>
<
IncrementSettings
InterceptMouseWheel
=
"false"
InterceptArrowKeys
=
"true"
/>
</
telerik:RadDateInput
>
However, on dates such as Sept. 30, 2011 when the day number (30th) is greater than the days in another month (for example, February 2011 only goes up to 28 days) then you can't use the mouse keys to change to or past that month. I have tried using the server side OnTextChanged for the RadDateInput to manually set the day to the 1st of the month at that time, but that didn't work. Setting an initial value in the RadDateInput using the current date and changing the day to the 1st also did not work for me. I've also tried using javascript on the client OnValueChanging event to re-enter the value with the day of 01, but that didn't work either. The javascript solution I tried:
function
changeDate(sender, args) {
var
tbVal = sender.get_textBoxValue();
if
(!(document.getElementById(
'<%= hdnDate.ClientID %>'
).value == tbVal)) {
var
month = tbVal.substr(0, 3);
var
year = tbVal.substr(4, 4);
var
newDate =
new
Date(Date.parse(month +
" 01, "
+ year));
document.getElementById(
'<%= hdnDate.ClientID %>'
).value = month +
" "
+ year;
window.setTimeout(
function
() { sender.set_selectedDate(newDate); }, 1);
}
}
<
telerik:RadDateInput
runat
=
"server"
ID
=
"rdiDate"
DateFormat
=
"MMM yyyy"
DisplayDateFormat
=
"MMM yyyy"
>
<
ClientEvents
OnValueChanging
=
"changeDate"
/>
<
IncrementSettings
InterceptMouseWheel
=
"false"
InterceptArrowKeys
=
"true"
/>
</
telerik:RadDateInput
>
<
input
runat
=
"server"
type
=
"hidden"
value
=
""
id
=
"hdnDate"
/>
Is there something I'm missing? or is this an issue with the RadDateInput control itself?