DatePicker focuses on hidden shared calendar when picking a date. How to stop?

2 posts, 1 answers
  1. Fred
    Fred avatar
    86 posts
    Member since:
    Sep 2008

    Posted 15 Jun 2009 Link to this post

    I did a search on focus and found two articles, but they don't seem to apply 100%

    http://www.telerik.com/community/forums/aspnet-ajax/calendar/raddatepicker-validation.aspx
    and 
    http://www.telerik.com/community/forums/aspnet-ajax/calendar/set-focus-after-date-selected.aspx

    Both of these, it's a single DatePicker choosing a date and getting focus back.

    I have about 30 dates on the page all using a hidden SharedCalendar at the top. When a user selects the date, they are sent to the top of the page.

    Is there a way on the SharedCalender to send the focus back to the DatePicker that called it? Or do I need to set something on every DatePicker?

    Was thinking something like..

     <telerik:RadCalendar ID="calShared" runat="server" EnableMultiSelect="false" ClientEvents-OnDateSelected="ResetFocus" />


     function ResetFocus(sender, args) {

                    //sender.focus();

                } 

    but that didn't work.

  2. Answer
    Veli
    Admin
    Veli avatar
    2002 posts

    Posted 17 Jun 2009 Link to this post

    Hello Fred,

    You are in the right direction. Try this:

    <telerik:RadDatePicker ID="RadDatePicker1" runat="server"
        <ClientEvents OnDateSelected="focusPicker" /> 
    </telerik:RadDatePicker> 

    function focusPicker(sender, args) 
        sender.get_dateInput().focus(); 

    Attaching the picker OnDateSelected client-side event to this method should work no matter how many date pickers you have on your screen.

    Kind regards,
    Veli
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top