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