5 Answers, 1 is accepted
0
Hi Roshan,
Thank you for contacting us.
You can achieve the desired look by modifying the format of the MonthViewHeader property as follows:
Hope this helps.
Regards,
Geri
Telerik
Thank you for contacting us.
You can achieve the desired look by modifying the format of the MonthViewHeader property as follows:
<
telerik:RadCalendar
MonthViewHeaderFormat
=
"yyyy"
/>
Hope this helps.
Regards,
Geri
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
RR
Top achievements
Rank 1
answered on 19 Mar 2015, 05:37 AM
Thanks Geri..
Please refer to the picture attached. there are both calendarHeader and mothsheaders. by adding
Both calendarHeader and monthHeaders are changing. But I want to change only the top calendar hear to the 'yyyy' format.
Please refer to the picture attached. there are both calendarHeader and mothsheaders. by adding
MonthViewHeaderFormat="yyyy
0
Hi Roshan,
The desired functionality does not come built-in in the RadCalendar. However, it can be achieved easily by modifying the ControlTemplate of the CalendarHeaderButton. You would need to find the the two TextBlock elements named "BackgroundText" and "ForegroundText" and change the text as needed by using IValueConverter:
Hope this helps.
Regards,
Geri
Telerik
The desired functionality does not come built-in in the RadCalendar. However, it can be achieved easily by modifying the ControlTemplate of the CalendarHeaderButton. You would need to find the the two TextBlock elements named "BackgroundText" and "ForegroundText" and change the text as needed by using IValueConverter:
Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource YearConverter}}"
Hope this helps.
Regards,
Geri
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
RR
Top achievements
Rank 1
answered on 20 Mar 2015, 01:20 PM
Hi teri
I have used the style of rad Calendar in a seperate style file. There in <Style x:Key="CalendarHeaderButton" TargetType="Button"> I have
How can I add the converter there. It says " property converter was not found in type 'templatebinding'"
Thank you..
I have used the style of rad Calendar in a seperate style file. There in <Style x:Key="CalendarHeaderButton" TargetType="Button"> I have
<
TextBlock
x:Name
=
"BackgroundText"
Foreground
=
"{StaticResource HeaderTextBackground}"
FontWeight
=
"{StaticResource HeaderTextFontWeight}"
HorizontalAlignment
=
"Center"
Margin
=
"0 2 0 0"
Text
=
"{TemplateBinding Content}"
VerticalAlignment
=
"Center"
/>
<
TextBlock
x:Name
=
"ForegroundText"
Foreground
=
"{StaticResource HeaderTextForeground}"
FontWeight
=
"{StaticResource HeaderTextFontWeight}"
HorizontalAlignment
=
"Center"
Margin
=
"0 1 0 1"
Text
=
"{TemplateBinding Content}"
VerticalAlignment
=
"Center"
/>
How can I add the converter there. It says " property converter was not found in type 'templatebinding'"
Thank you..
0
Hello Roshan,
In order to use the value converter, you need to replace TemplateBinding with Binding and set the RelativeSource as shown in the code below:
Hope this helps.
Regards,
Geri
Telerik
In order to use the value converter, you need to replace TemplateBinding with Binding and set the RelativeSource as shown in the code below:
Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource YearConverter}}"
Hope this helps.
Regards,
Geri
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.