RadCalendar based on the specific month

5 posts, 0 answers
  1. Brown
    Brown avatar
    48 posts
    Member since:
    Dec 2010

    Posted 13 Jan 2011 Link to this post

    Hi 

     I am having drop down list in my page has all the month names.
    If i click on the month based on that rad calendar should display..
    Could you please tell me how to do?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 14 Jan 2011 Link to this post

    Hello Brown,


    You could do this from client side. Check the code shown below.

    client code:
    function selectMonth() {
        var dropDown = document.getElementById("DropDownList1");
        for (var index = 0; index < dropDown.length; index++) {
            if (dropDown[index].selected == true) {
                var calendar = $find('<%=RadCalendar3.ClientID  %>');
                var triplet = [2011, dropDown[index].value, 1];
                calendar.navigateToDate(triplet);             
                break;
            }
        }
    }

    and ASPX:
    <telerik:RadCalendar ID="RadCalendar3" runat="server">
    </telerik:RadCalendar>
    <br />
    <asp:DropDownList ID="DropDownList1" runat="server" onchange="selectMonth();">
        <asp:ListItem Text="January" Value="1"></asp:ListItem>
        <asp:ListItem Text="February" Value="2"></asp:ListItem>
        <asp:ListItem Text="March" Value="3"></asp:ListItem>
        <asp:ListItem Text="April" Value="4"></asp:ListItem>
            . . .
    </asp:DropDownList>



    -Shinu.
  3. Brown
    Brown avatar
    48 posts
    Member since:
    Dec 2010

    Posted 14 Jan 2011 Link to this post

    Hi Shinu,, i tried this code. i think that $find is Jquery? it is showing error on my page while executing : is expected.....
  4. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 18 Jan 2011 Link to this post

    Hi Brown,

    The $find method provides a shortcut to the findComponent method of the Sys.Application class. Refer to the link below for more information on this matter:
    http://msdn.microsoft.com/en-us/library/bb397441.aspx.

    Also please find attached a sample application which works correctly using Shinu's code.

    Best wishes,
    Maria Ilieva
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  5. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 18 Jan 2011 Link to this post

    Hi Brown,

    The $find method provides a shortcut to the findComponent method of the Sys.Application class. Refer to the link below for more information on this matter:
    http://msdn.microsoft.com/en-us/library/bb397441.aspx.

    Also please find attached a sample application which works correctly using Shinu's code.

    Best wishes,
    Maria Ilieva
    the Telerik team
    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top