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

Customize Calendar Month Previous Next Buttons

3 Answers 115 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Edward
Top achievements
Rank 1
Edward asked on 26 Aug 2010, 09:30 PM
I want to customize the Previous and Next Month Buttons in the Calendar.

I implemented

 

 

 

<telerik:RadCalendar x:Name="_calendar" Width="257" Height="215" AreWeekNumbersVisible="False"

 

 

 

FontFamily="Arial" FontSize="12" Foreground="White" Background="Black" BorderBrush="Black"

 

 

 

DayTemplateSelector="{StaticResource calendarButtonTemplateSelector}"

 

 

 

DayButtonStyle="{x:Null}" IsTodayHighlighted="False" DisplayMode="MonthView"

 

 

 

HorizontalAlignment="Left" VerticalAlignment="Top" BorderThickness="0"

 

 

 

MonthButtonStyleSelector="{StaticResource monthButtonSelector}" >

 


the MonthButtonStyleSelector does not appear to call my templates.  I just want the Previous Next buttons to be a little bit bigger.

I am hoping you just did a transform on the Wingding 6 character and i will be able to simply change the fontsize. 
I am trying

 

 

 

<local:MonthButtonStyleSelector x:Key="monthButtonSelector" >

 

 

 

 

<local:MonthButtonStyleSelector.PreviousStyle>

 

 

 

 

<Style TargetType="calendar:CalendarButton" >

 

 

 

 

<Setter Property="FontSize" Value="22" />

 

 

 

 

</Style>

 

 

 

 

</local:MonthButtonStyleSelector.PreviousStyle>

 

 

 

 

<local:MonthButtonStyleSelector.NextStyle>

 

 

 

 

<Style TargetType="calendar:CalendarButton" >

 

 

 

 

<Setter Property="FontSize" Value="22" />

 

 

 

 

</Style>

 

 

 

 

</local:MonthButtonStyleSelector.NextStyle>

 

 

 

 

</local:MonthButtonStyleSelector>

 


Is this correct?  i also of course implemented MonthButtonStyleSelector
But it does not appear to ever get called.
any suggestions?
will the daybuttontemplateselector interfere with the monthbuttonstyle selector?

ed

3 Answers, 1 is accepted

Sort by
0
Dani
Telerik team
answered on 27 Aug 2010, 02:45 PM
Hi Edward,

As far as I understand you would like to customize the Next and Previous buttons only. You can easily do that with no need to create and use Selectors.
 
Open RadCalendar in Blend and generate its template by going to Object > Edit Template > Edit a Copy. Inside the generated Style, you will find the buttons:

...
<RepeatButton x:Name="MoveLeft" Grid.Column="0" Style="{StaticResource MoveLeftButtonStyle}"/>
<Button x:Name="Header" Grid.Column="1" Style="{StaticResource CalendarHeaderButton}"/>
<RepeatButton x:Name="MoveRight" Grid.Column="2" Style="{StaticResource MoveRightButtonStyle}"/>
...

Edit the MoveLeftButtonStyle and MoveRightButtonStyle to customize the two buttons.

Please, contact us again if you need further help.

Best wishes,
Dani
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Edward
Top achievements
Rank 1
answered on 27 Aug 2010, 08:06 PM
Greetings,

I followed your instructions and created a resourcedictionary.  In the App.xaml I merged in the new resource dictionary. 

I implemented a ScaleTransform on the two path statements for the MoveRightButtonStyle.  I left the MoveLeftButtonStyle alone.

<Path x:Name="BackgroundIcon" Data="M0,0 L0,7 1,7 1,6 2,6 2,5 3,5 3,4 4,4 4,3 3,3 3,2 2,2 2,1 1,1 1,0 z" Fill="{StaticResource HeaderButtonIconBackground_Normal}" Height="7" Margin="0 2 0 0" Width="16">
    <Path.RenderTransform>
        <ScaleTransform CenterX="0" CenterY="0" ScaleX="2" ScaleY="2"/>
    </Path.RenderTransform>
</Path>
<Path x:Name="ForegroundIcon" Data="M0,0 L0,7 1,7 1,6 2,6 2,5 3,5 3,4 4,4 4,3 3,3 3,2 2,2 2,1 1,1 1,0 z" Fill="{StaticResource HeaderButtonIconForeground_Normal}" Height="7" Margin="0 1 0 1" Width="16">
    <Path.RenderTransform>
        <ScaleTransform CenterX="0" CenterY="0" ScaleX="2" ScaleY="2"/>
    </Path.RenderTransform>
</Path>

I then compiled and ran.  It does not seem to pick up my modification.  Any clue?

i think I see what might be happening.  When i merged in my new resource dictionary through app.xaml.  It will not get picked up my the telerik control because the telerik controls have no knowleged of it.  How can I get around this?


ed
0
Dani
Telerik team
answered on 01 Sep 2010, 06:24 AM
Hi Edward,

Thank you for your reply.

I believe your styles from App.xaml do not get applied at all. Have you applied a Style by x:Key to RadCalendar in MainPage.xaml (or whatever page RadCalendar is placed in)?  If the answer is yes, and you still are not able to apply the styles to the control, please send us your project to test the issue.


Best wishes,
Dani
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Calendar
Asked by
Edward
Top achievements
Rank 1
Answers by
Dani
Telerik team
Edward
Top achievements
Rank 1
Share this question
or