I am having an issue setting focus on the text box of a RadDatePicker. I handle the
OnDateSelected
event and then set focus using:
e.get_textBox().focus();
e.get_textBox().select();
however this only works when there is no date in the textbox. If I choose another date focus may be at that object but the cursor is not visible. Currently I have a workaround to handle this but it is not elegant:
function
OnDatePopupClosing(e, args) {
try
{
SelectedDate = e.get_selectedDate();
if (SelectedDate) {
e.get_textBox().value =
''
;
}
}
catch (err) {
alert(
"Error encountered: " + err.message)
}
}
function
OnDateSelected(e, args) {
try
{
if (e.CalendarSelectionInProgress) {
e.get_textBox().select();
}
}
catch (err) {
alert(
"Error encountered: " + err.message)
}
}