This is a migrated thread and some comments may be shown as answers.

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

8 Answers 168 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
pavani
Top achievements
Rank 1
pavani asked on 08 Mar 2011, 06:28 AM
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

8 Answers, 1 is accepted

Sort by
0
pavani
Top achievements
Rank 1
answered on 11 Mar 2011, 07:52 AM
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....
0
Daniel
Telerik team
answered on 11 Mar 2011, 10:37 AM
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!
0
pavani
Top achievements
Rank 1
answered on 11 Mar 2011, 12:32 PM

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...

0
Daniel
Telerik team
answered on 11 Mar 2011, 06:01 PM
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!
0
pavani
Top achievements
Rank 1
answered on 14 Mar 2011, 07:58 AM

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

 

0
pavani
Top achievements
Rank 1
answered on 16 Mar 2011, 06:32 AM
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.
0
Daniel
Telerik team
answered on 16 Mar 2011, 10:28 PM
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!
0
Daniel
Top achievements
Rank 1
answered on 22 Aug 2017, 12:55 PM

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.

Tags
Calendar
Asked by
pavani
Top achievements
Rank 1
Answers by
pavani
Top achievements
Rank 1
Daniel
Telerik team
Daniel
Top achievements
Rank 1
Share this question
or