Numeric Gauge - Font Foreground should change based on value range

2 posts, 1 answers
  1. Shanmugam
    Shanmugam avatar
    5 posts
    Member since:
    Oct 2010

    Posted 10 Dec 2010 Link to this post

    I have tried a lot on this to find out range property for numeric gauge control, its there for linear gauge and others but not for numeric gauge control. I have a criteria to change font color (foreground) base on the value range. please let me know the solution for the same.

    here is my code

    <telerik:RadGauge x:Name="radGauge"
                              Height="45"
                              VerticalAlignment="Stretch"
                              HorizontalAlignment="Stretch"
                              Margin="-15,0,0,0"
                              BorderThickness="0">
                <telerik:NumericScale Min="0" Width="155" BorderThickness="0" >
                    <telerik:IndicatorList BorderThickness="0" >
                        <telerik:NumericIndicator x:Name="numericIndicator"
                                                  Format="{}{0:F2}"
                             Foreground="DarkBlue"
                                                  Left="0"
                                                  Top="0"
                                                  Value="{Binding ProjectVisibilityDataProp.Visibility}"
                                                  RelativeWidth="1.009"
                                                  RelativeHeight="0.99"
                                                  Background="White"
                                                  BorderThickness="0"
                                                  FontSize="45">
                            <telerik:NumberPosition CornerRadius="0" />
                            <telerik:NumberPosition CornerRadius="0" />
                            <telerik:NumberPosition CornerRadius="0"  RelativeWidth="0.5" />
                            <telerik:NumberPosition CornerRadius="0" />
                            <telerik:NumberPosition CornerRadius="0" />
                        </telerik:NumericIndicator>
                    </telerik:IndicatorList>
                </telerik:NumericScale>
            </telerik:RadGauge>

    Thanks
    Shanmugam
  2. Answer
    Andrey
    Admin
    Andrey avatar
    1681 posts

    Posted 15 Dec 2010 Link to this post

    Hello Shanmugam,

    The numeric scale does not support the ranges visualization as linear or radial scale, but it supports the range list which contains RangeBase class instances. So, you can use them to specify the range (min and max) and the IndicatorBackground property.
    At present, the numeric indicator does not support using range colors directly, but as workaround you can use an IndicatorBase class instance and then bind its background to the Foreground property of the Numeric Indicator.

    We have created the PITS issue to implement this feature in future releases. You can track it using the following link:
    http://www.telerik.com/support/pits.aspx#/public/silverlight/4343

    I have attached a sample solution which changes font color of Numeric Indicator base on the ranges.

    Best wishes,
    Andrey Murzov
    the Telerik team

    Browse the videos here>> to help you get started with RadControls for Silverlight
  3. DevCraft banner
Back to Top