RadMonthYearPicker Popup by input

5 posts, 0 answers
  1. Joseph
    Joseph avatar
    29 posts
    Member since:
    Jun 2014

    Posted 25 Jun 2014 Link to this post

    Is there a way that i can trigger the popup by user click on input field (textbox)?  Thank you.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 26 Jun 2014 in reply to Joseph Link to this post

    Hi Jospeh,

    Please try to attach the onfocus event to RadMonthYearPicker and show the pop up as follows.

    ASPX:
    <telerik:RadMonthYearPicker ID="RadMonthYearPicker1" runat="server" onfocus="openPopUp()">
    </telerik:RadMonthYearPicker>

    JavaScript:
    function openPopUp() {
        var monthYearPicker = $find("<%=RadMonthYearPicker1.ClientID%>");
        monthYearPicker.showPopup();
    }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Joseph
    Joseph avatar
    29 posts
    Member since:
    Jun 2014

    Posted 26 Jun 2014 in reply to Princy Link to this post

    Hi Princy,

    That didn't work, getting the error: 

    0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'showPopup'
  5. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 26 Jun 2014 in reply to Joseph Link to this post

    Hi Joseph,

    Please try the below approaches to achieve your scenario.  

    • One approach is that please try to set the ShowPopupOnFocus property as true in ASPX as follows.

    ASPX:

    <telerik:RadMonthYearPicker ID="RadMonthYearPicker1" runat="server" ShowPopupOnFocus="true">
    </telerik:RadMonthYearPicker>

    • Another approach is that onfocus event call the click event of popup button as follows.

    ASPX:

    <telerik:RadMonthYearPicker ID="RadMonthYearPicker1" runat="server" onfocus="openPopUp()">
    </telerik:RadMonthYearPicker>

    JavaScript:
    function openPopUp() {
        var monthYearPicker = $find("<%=RadMonthYearPicker1.ClientID%>");
        monthYearPicker._popupButton.click();
    }

    Hope this will help you.
    Thanks,
    Princy.
  6. Joseph
    Joseph avatar
    29 posts
    Member since:
    Jun 2014

    Posted 27 Jun 2014 in reply to Princy Link to this post

    Thank You.  That worked.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017