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

Changing the font size for the text associated with a rating

3 Answers 66 Views
Rating
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Pat
Top achievements
Rank 1
Pat asked on 23 Apr 2012, 12:32 PM
How can I change the FontSize for the text associated with rating.
I ave tried the FontSize property for the Rating control but it seems to have no effect.

3 Answers, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 23 Apr 2012, 02:13 PM
Hello Pat,

Thank you for contacting us.

You should be able to change the size of the text with the FontSize property of RadRating or RadRatingItem. Here is an example:
<telerikInput:RadRating FontSize="20">
    <telerikInput:RadRatingItem Content="1"/>
    <telerikInput:RadRatingItem Content="2" FontSize="30"/>
    <telerikInput:RadRatingItem Content="3"/>
    <telerikInput:RadRatingItem Content="4" FontSize="30"/>
    <telerikInput:RadRatingItem Content="5"/>
</telerikInput:RadRating>

Is this how you associated the text with the rating? And which of the FontSize properties has no effect on your side: RadRating's or RadRatingItem's?

I'm looking forward to your reply.

Kind regards,
Todor
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Pat
Top achievements
Rank 1
answered on 23 Apr 2012, 05:27 PM
My apologies, This was user error.  I was setting the FontSize on the wrong control - not the rating control I thought i was changing.
0
Vijay
Top achievements
Rank 1
answered on 03 Jun 2012, 05:22 PM
Hello Pat,

 Please find the below sample XAML code. This time it should work out well. Please use the sample code for an idea changing the font size for text in rating control.

<phone:PhoneApplicationPage
 x:Class="Rad_Rating_Application.MainPage"
 xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
 xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
 mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
 FontFamily="{StaticResource PhoneFontFamilyNormal}"
 FontSize="{StaticResource PhoneFontSizeNormal}"
 Foreground="{StaticResource PhoneForegroundBrush}"
 SupportedOrientations="Portrait" Orientation="Portrait"
 shell:SystemTray.IsVisible="True" xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
 >
 
<!--LayoutRoot is the root grid where all page content is placed-->
 <Grid x:Name="LayoutRoot" Background="Transparent">
 <Grid.RowDefinitions>
 <RowDefinition Height="Auto"/>
 <RowDefinition Height="*"/>
 </Grid.RowDefinitions>
 
<!--TitlePanel contains the name of the application and page title-->
 <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
 <TextBlock x:Name="ApplicationTitle" Text="Rad Rating Application" FontFamily="Verdana" FontSize="22" Style="{StaticResource PhoneTextNormalStyle}"/>
 <TextBlock x:Name="PageTitle" Text="Windows 7 Phone" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
 </StackPanel>
 
<!--ContentPanel - place additional content here-->
 <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
 
<TextBlock Height="30"
 HorizontalAlignment="Left"
 Margin="0,23,0,0"
 Name="textBlock1"
 Text="Please Enter First Number: "
 FontFamily="Verdana"
 FontSize="22"
 VerticalAlignment="Top" />
 
<TextBlock Height="30"
 Margin="6,0,0,370"
 Name="textBlock2"
 Text="Please Enter Second Number: "
 FontFamily="Verdana"
 FontSize="22" />
 
<TextBox Height="72"
 HorizontalAlignment="Left"
 Margin="325,84,0,0"
 Name="textBox1"
 VerticalAlignment="Top"
 Width="131" />
 
<TextBox Height="72"
 HorizontalAlignment="Left"
 Margin="325,0,0,0"
 Name="textBox2"
 VerticalAlignment="Top"
 Width="131" />
 
<telerikInput:RadRating HorizontalAlignment="Left"
 Margin="119,241,0,0"
 VerticalAlignment="Top"
 RatingDisplayPrecision="Half"
 ItemShapeStyle="Hearts1"
 Name="radRating1"
 RatingSelectionMode="Single"
 Width="203">
 
 <telerikInput:RadRating.ItemShapeUnselectedStyle>
 <Style TargetType="Path">
 <Setter Property="Fill" Value="Transparent"></Setter>
 <Setter Property="Stroke" Value="White"></Setter>
 <Setter Property="StrokeThickness" Value="3"></Setter>
 </Style>
 </telerikInput:RadRating.ItemShapeUnselectedStyle>
 
<telerikInput:RadRating.ItemShapeSelectedStyle>
 <Style TargetType="Path">
 <Setter Property="Fill" Value="Green"></Setter>
 <Setter Property="Stroke" Value="Red"></Setter>
 <Setter Property="StrokeThickness" Value="3"></Setter>
 </Style>
 </telerikInput:RadRating.ItemShapeSelectedStyle>
 
 
 <telerikInput:RadRating.ItemShapeHighlightedStyle>
 <Style TargetType="Path">
 <Setter Property="Fill" Value="DeepSkyBlue"></Setter>
 <Setter Property="Stroke" Value="Violet"></Setter>
 <Setter Property="StrokeThickness" Value="3"></Setter>
 </Style>
 </telerikInput:RadRating.ItemShapeHighlightedStyle>
 
<telerikInput:RadRatingItem x:Name="item1" Content="+" FontFamily="Verdana" FontSize="48" Foreground="DeepSkyBlue" Tap="item1_Tap"/>
 <telerikInput:RadRatingItem x:Name="item2" Content="-" FontFamily="Verdana" FontSize="48" Foreground="DeepSkyBlue" Tap="item2_Tap"/>
 <telerikInput:RadRatingItem x:Name="item3" Content="*" FontFamily="Verdana" FontSize="48" Foreground="DeepSkyBlue" Tap="item3_Tap"/>
 <telerikInput:RadRatingItem x:Name="item4" Content="/" FontFamily="Verdana" FontSize="48" Foreground="DeepSkyBlue" Tap="item4_Tap"/>
 
</telerikInput:RadRating>
 
 </Grid>
 </Grid>
 
</phone:PhoneApplicationPage>



Thanks and Regards,
Vijay
MVC Corp.

Tags
Rating
Asked by
Pat
Top achievements
Rank 1
Answers by
Todor
Telerik team
Pat
Top achievements
Rank 1
Vijay
Top achievements
Rank 1
Share this question
or