Custom label inside RadRadialGauge

5 posts, 1 answers
  1. nCubed
    nCubed avatar
    6 posts
    Member since:
    Nov 2011

    Posted 07 Dec 2011 Link to this post

    In reviewing the post How do i make a label inside a gauge? it appears that the code sample may be for a previous version of the Gauge?

    The sample does appear to sort of work by importing the 
    namespace. However, the label location is always at the top left of the UserControl the RadRadialGauge is contained within.

    Is there an updated sample that demonstrates how to use a custom label inside a gauge that will scale when the gauge is resized?

  2. Answer
    Andrey avatar
    1681 posts

    Posted 12 Dec 2011 Link to this post

    Hello Ncubed,

    The new version of the gauge control allows positioning of any FrameworkElement over the gauge using relative measurements. To do it you should put a desirable element (TextBlock, for example) to the CustomItems property of the scale object:

        <telerik:RadialScale Name="scale">
                <telerik:Marker Name="marker"
                        Value="60" />
                <TextBlock Text="12345"
                       telerik:ScaleObject.RelativeY="0.2" />
                <TextBlock Text="C"
                       telerik:RadialScale.RotationMode="SurroundOut" />

    There are 2 ways of the positioning using relative measurement:
    1. Using ScaleObject.RelativeX and ScaleObject.RelativeY attached properties. These 2 properties set X and Y coordinates of the object using relative measurement.
    2. Using ScaleObject.Value, ScaleObject.Location and ScaleObject.Offset attached properties. The ScalObject.Value property specify the value along the scale where put the object. The ScaleObject.Location and ScaleObject.Offset specify object location relative to the scale bar boundaries and offset from this location.

    You can use Use Canvas.ZIndex attached property to position object over or under some scale elements. The scale objects have following default ZIndex:
    1. Range – 100
    2. Tick mark – 200
    3. Label – 300
    4. Indicator – 400

    Best wishes,
    Andrey Murzov
    the Telerik team

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

  3. nCubed
    nCubed avatar
    6 posts
    Member since:
    Nov 2011

    Posted 14 Dec 2011 Link to this post

    Hello Andrey,

    Thank you for the example and the detailed explanation of the attached properties. Everything works well and as expected.

  4. Kalaivanan
    Kalaivanan avatar
    1 posts
    Member since:
    Mar 2015

    Posted 24 Mar 2015 Link to this post

    how can use the Guage controls in Windows Forms...     
  5. Milena
    Milena avatar
    226 posts

    Posted 25 Mar 2015 Link to this post

    Hi Kalaivanan,

    It is possible to host WPF control inside Windows Forms application. In order to achieve this you should:
    - add reference to WindowsFormsIntegration and System.Xml dll in your project 
    - add WPF UserContol in your project (with the RadGauge for instance)
    - add ElementHost in your WinForm where you can host a WPF UserControl

    For your convenience I implemented this approach in the attached project. You can take a look at it and see if it works for you.

    Moreover, if you write Windows Forms application you can take a look at our UI for WinForms. Since last year we added RadialGauge and LinearGauge to our suite for WinForms UI controls. 

    Lastly I would ask you to keep the communication for a particular topic in a single thread. (the topic of this forum post is "Custom label inside RadRadialGauge"). This way we will be able to track the issue easier, organize our communication history better and assist you in a more convenient manner. We appreciate your understanding in this matter. 

    I hope this information will help you and don't hesitate to write back if you have more questions.


    See What's Next in App Development. Register for TelerikNEXT.

Back to Top