How to get radial gauge needle to move

2 posts, 0 answers
  1. Jeffrey
    Jeffrey avatar
    1 posts
    Member since:
    Dec 2010

    Posted 21 Dec 2010 Link to this post

    i am new to SL development. i have bulit a SL navigation project and placed a radial gauge in it. can you please show me how to pass values to the gauge that makes the needle move  in the code behind.

    home.xaml code
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"
    Style="{StaticResource PageStyle}">
    <Grid x:Name="LayoutRoot">
    <ScrollViewer x:Name="PageScrollViewer" Style="{StaticResource PageScrollViewerStyle}">
    <StackPanel x:Name="ContentStackPanel">
    <TextBlock x:Name="HeaderText" Style="{StaticResource HeaderTextStyle}" 
    <TextBlock x:Name="ContentText" Style="{StaticResource ContentTextStyle}" 
    Text="Home page content"/>
    <!--main RadGauge root container --> 
    <telerik:RadGauge Name="radGauge" Width="300" Height="300">
    <!-- Add RadialGauge container to the internal RadGauge layout. -->
    <!-- Now you can insert RadialScale object into the radial gauge container for further configuration. For example, you can set Min and Max properties of the scale: -->
    <telerik:RadialScale Name="radialScale" Min="0" Max="1000">
    <!-- The last object you have to add is indicator (for example, needle indicator). You have to insert the list of the indicators to the radial scale object and then add needle indicator there: -->
    <telerik:Needle Name="needle" Value="100"/>
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Animation;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    //you have to add telerik using here
    using Telerik.Windows.Controls.Gauges;
    using Telerik.Windows.Controls;
    namespace thermometerNavigation
    public partial class Home : Page
    public Home()
    // Executes when the user navigates to this page.
    protected override void OnNavigatedTo(NavigationEventArgs e)
  2. Andrey
    Andrey avatar
    1681 posts

    Posted 23 Dec 2010 Link to this post

    Hello Jeffrey,

    You can simply assign new value to the Value property of the needle to move it to different position. In your C# code you can do it for example using the Loaded event.
    public Home()

    Loaded += new RoutedEventHandler(Home_Loaded);

    Home_Loaded(object sender, RoutedEventArgs e)
        this.needle.Value = 500d;

    All the best,
    Andrey Murzov
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for WPF
Back to Top