Get Month Name From RadCalendar Year View By Clicking on Single Month

9 posts, 0 answers
  1. pavani
    pavani avatar
    5 posts
    Member since:
    Mar 2011

    Posted 08 Mar 2011 Link to this post

    Hi,

                   Iam Using RadCalendar Control. Iam displaying Year view Calendar in 4 Columns and 3 Rows by setting MultiViewColumn property and MultiViewRow property. Now Iam able to access only main Header i.e, Year Header not Month Headers. My Requirement is when i click on Particular month i should display only that month other months shouldn't appear. But Iam not able to click on Months in my RadCalendar(Year View). I need help on this Issue..


    Thanks & Regards,
    Pavani
  2. pavani
    pavani avatar
    5 posts
    Member since:
    Mar 2011

    Posted 11 Mar 2011 Link to this post

    Hello....
       Please help me.. it is very urgent for me. I've to focus on particular month when i click on a month in Rad Year View Calendar?

    I wrote the below code for making the month name as Hyperlink but no use.

    protected

     

    void rcHolidayList_PreRender(object sender, EventArgs e)

     

     

    {

     

     

        foreach (CalendarView view in rcHolidayList.CalendarView.ChildViews)

     

     

        {

     

            ((

    MonthView)view).TitleFormat = "<a href='www.google.co.in'>"+"MMMM yyyy"+"</a>";

     

     

        }

     

    }


    please check it once and let me know what is wrong in that code....
  3. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 11 Mar 2011 Link to this post

    Hello Pavani,

    You have to escape the special characters as demonstrated below:
    protected void RadCalendar1_PreRender(object sender, EventArgs e)
    {
        foreach (CalendarView view in RadCalendar1.CalendarView.ChildViews)
        {
            (view as MonthView).TitleFormat = "<a \\hre\\f='\\http://www.google.co.in'>" + "MMMM yyyy" + "</a>";
        }
    }

    Best regards,
    Daniel
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  4. pavani
    pavani avatar
    5 posts
    Member since:
    Mar 2011

    Posted 11 Mar 2011 Link to this post


    Hi,

                   Thanks for your code. now it is working fine. I need one more help  Is there any facility to add link button in the place of Hyperlink....  when i click on that link button, instead of going to Google site, I want to get the Month Name, is there any event to fire whenever i click on that link button. I need that code.

    protected

     

    void rcHolidayList_PreRender(object sender, EventArgs e)

     

     

    {

     

     

     

     

    foreach (CalendarView view in rcHolidayList.CalendarView.ChildViews)

     

     

    {

     

     

    (view as MonthView).TitleFormat = "<a \\hre\\f='\\http://www.google.co.in'>" + "MMMM yyyy" + "</a>";
    //(view as MonthView).ChildViews.Add(InputItem)  

     

    }

    }

    please tell me for what purpose the commented line is used...

  5. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 11 Mar 2011 Link to this post

    Hello Pavani,

    You can simply add a client-side onclick handler to the anchor:
    (view as MonthView).TitleFormat = "<a onclick='alert(\"Test\")'>" + "MMMM yyyy" + "</a>";

    Regards,
    Daniel
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  6. pavani
    pavani avatar
    5 posts
    Member since:
    Mar 2011

    Posted 14 Mar 2011 Link to this post

    Hi Daniel,

                Thank you very much!.. I wnat to place <asp:LinkButton> in the place of <a> anchor tag in the below code. Please send the code.

     

     

    (view

    as MonthView).TitleFormat = "<a onclick='alert(\" Hi \")'>" + "MMMM yyyy" + "</a>";


    with Regards,
    Pavani

     

  7. pavani
    pavani avatar
    5 posts
    Member since:
    Mar 2011

    Posted 16 Mar 2011 Link to this post

    Hi Daniel,

                   Is it possible to place the LinkButton in the place of anchor tag. If possible please send me the code. I want to place the month name of RadCalendar as link button dynamically in codebehind file.

    Thanks & Regards,
    Pavani.
  8. Daniel
    Admin
    Daniel avatar
    4949 posts

    Posted 16 Mar 2011 Link to this post

    Hello Pavani,

    There is no easy way to insert server-side control at this place. I recommend that you use a client approach if possible.

    Regards,
    Daniel
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  9. Daniel
    Daniel avatar
    8 posts
    Member since:
    Sep 2016

    Posted 22 Aug 2017 Link to this post

    Hi, 

    I've the same problem but with RadCalendar of WinForms Telerik library. I can't see CalendarView property on RadCalendar control.

    How can I achieve the same result for my winform desktop application?

     

    Thanks in advance.

Back to Top