Gauge not shown

4 posts, 0 answers
  1. YongKoo Kang
    YongKoo Kang avatar
    101 posts
    Member since:
    Jan 2010

    Posted 12 Apr 2011 Link to this post

    Hi telerik team,

    I succeeded to load RadGauge on my view and bind to my bisiness object,
    so I created style in order to bind many gauges in itemscontrol,however
    gauge is not shown but needle only does. Following is my style in resource dictionary.
    <Style x:Key="GaugeStyle" TargetType="telerik:HeaderedContentControl">
            <Setter Property="HorizontalAlignment" Value="Stretch" />
            <Setter Property="VerticalAlignment" Value="Stretch" />
            <Setter Property="HorizontalContentAlignment" Value="Stretch" />
            <Setter Property="VerticalContentAlignment" Value="Stretch" />
            <Setter Property="Template">
                    <ControlTemplate TargetType="telerik:HeaderedContentControl">
                        <Border Style="{StaticResource BorderStyle}" Margin="2">
                                    <RowDefinition Height="30"/>
                                    <RowDefinition Height="*"/>
                                    <ColumnDefinition Width="0.65*"/>
                                    <ColumnDefinition Width="0.35*"/>
                                <TextBlock Grid.Column="0" Text="{Binding Path=HeatPartName}" Style="{StaticResource TextBlockStyle}"/>
                                <TextBlock Grid.Column="1" Text="{Binding Path=CurrentThermo}" Style="{StaticResource TextBlockStyle}"
                                    HorizontalAlignment="Right" />
                                <ContentPresenter Grid.Row="1">
                                        <telerik:RadGauge  Grid.Row="1" Margin="3"
                                            <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                                                             Min="0" Max="40" MajorTicks="8" MiddleTicks="4" 
                                                        <telerik:MajorTickProperties Length="0.1"/>
                                                        <telerik:MiddleTickProperties Length="0.07" />
                                                        <telerik:LabelProperties FontSize="8" />
                                                    <telerik:RadialRange Min="{Binding Path=Model.StdThermoLow}" Max="{Binding Path=Model.StdThermoHigh}" StartWidth="0.05" EndWidth="0.05" Background="Green"
                                                                 TickBackground="Green" LabelForeground="Green" IndicatorBackground="Green" />
                                                        <telerik:RadialBar IsAnimated="True" Value="{Binding Path=Model.CurrentThermo}" />
                                                        <telerik:Needle IsAnimated="true" Value="{Binding Path=Model.CurrentThermo}" />

    I guess I missed static resouce,so added style with resource dictinary as bellows
    but view unresponed for a long time and  finally complains stack overflow saying
    "element is already another child of ..".

            <ResourceDictionary Source="Fonts.xaml"/>
            <ResourceDictionary Source="/Telerik.Windows.Controls.Gauge;component/Themes/Generic.xaml" />

    Style is added as follows with above code.

     <telerik:RadGauge   Style="{StaticResource RadialGaugeHalfCircleNStyle}">
     <telerik:RadialScale Style="{StaticResource RadialScaleHalfCircleNStyle}"

    I heared it hurts performance when using sperated module with separate dictionary,
    but it looks my ignorance to apply style in this case.

    Any sample or advice would be highly appreciated.
    Thank you in advance.


  2. YongKoo Kang
    YongKoo Kang avatar
    101 posts
    Member since:
    Jan 2010

    Posted 14 Apr 2011 Link to this post

    Any thoughts ?

  3. DevCraft R3 2016 release webinar banner
  4. Andrey
    Andrey avatar
    1681 posts

    Posted 15 Apr 2011 Link to this post

    Hi Yong-Gu Kang,

    You have missed the RadialGauge container which should be used as the container for the RadialScale element.
     <telerik:RadGauge  Grid.Row="1" Margin="3">
      <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
         Min="0" Max="40" MajorTicks="8" MiddleTicks="4" 

    The tick marks and labels have white colour when you use default theme.
    So, they are invisible.

    Second thing I would note is the following use of the RadialGaugeHalfCircleNStyle style is incorrect:
    <telerik:RadGauge Style="{StaticResource RadialGaugeHalfCircleNStyle}">

    Its target is the RadialGauge control and it cannot be applied to the RadGauge.

    Kind regards,
    Andrey Murzov
    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
  5. YongKoo Kang
    YongKoo Kang avatar
    101 posts
    Member since:
    Jan 2010

    Posted 15 Apr 2011 Link to this post

    Hi Andrey,

    Thank you for your kind reply and I'm feel sorry to bother you with this simple thing.
    Though I read your document a time, I might not  understand RadGause control full enough.

    Thank you again.



Back to Top