Numberindicator

12 posts, 0 answers
  1. Grtjn
    Grtjn avatar
    129 posts
    Member since:
    Feb 2010

    Posted 12 Mar 2010 Link to this post

    Hi,

    Is there some samplecode available for numberindicator in code-behind (c#) ?!

    Kind regards,

    Gertjan
  2. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 12 Mar 2010 Link to this post

    Hi GJ DM,

    You can create number indicator in code-behind like this:

    RadGauge gauge = new RadGauge() { Width = 150, Height = 50 };
    NumericScale scale = new NumericScale() { Min = 0, Max = 1000 };
    IndicatorList indicatorList = new IndicatorList();
    NumericIndicator numericIndicator = new NumericIndicator() { Value = 51.23, Format = "{0:F2}", Left = 0, Top = 0, RelativeHeight = 1, RelativeWidth = 1, FontWeight = FontWeights.Bold, FontSize = 30, BorderThickness = new Thickness(0) };
    numericIndicator.Items.Add(new NumberPosition() { CornerRadius = new CornerRadius(0) });
    numericIndicator.Items.Add(new NumberPosition() { CornerRadius = new CornerRadius(0) });
    numericIndicator.Items.Add(new NumberPosition() { CornerRadius = new CornerRadius(0) });
    numericIndicator.Items.Add(new NumberPosition() { CornerRadius = new CornerRadius(0) });
    numericIndicator.Items.Add(new NumberPosition() { CornerRadius = new CornerRadius(0) });
    numericIndicator.Items.Add(new NumberPosition() { CornerRadius = new CornerRadius(0) });
     
    indicatorList.Items.Add(numericIndicator);
    scale.Items.Add(indicatorList);
    gauge.Content = scale;



    All the best,
    Freddie
    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.
  3. DevCraft banner
  4. Grtjn
    Grtjn avatar
    129 posts
    Member since:
    Feb 2010

    Posted 15 Mar 2010 Link to this post

    Hi,

    I tried the code you posted, but i get errors on the cornerradius!
    'Telerik.Windows.Controls.Gauges.Numberposition does not contain a definition for 'CornerRadius'

    How can I get this right? And do I need the cornerradius for this numbericindicator?

    Edit:
    My goal is to add this numbericindicator to a halfcircle gauge. This is possible, right ?

    Kind regards,

    Gertjan
  5. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 18 Mar 2010 Link to this post

    Hi GJ DM,

    Attached is a runnable sample application that demonstrates the desired functionality (note that it uses the latest official version of the controls Q1 2010 released earlier this month).

    Hope this helps.


    All the best,
    Freddie
    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.
  6. Grtjn
    Grtjn avatar
    129 posts
    Member since:
    Feb 2010

    Posted 19 Mar 2010 Link to this post

    Hi,

    First of all thanks for the reply. When running your project everything did go just fine and i could see the numeric indicator.
    But when I started to insert your code in my project I again did get an error concerning the CornerRadius!

    Error 4 'Telerik.Windows.Controls.Gauges.NumberPosition' does not contain a definition for 'CornerRadius' C:\Users\gertjan.demeyer\Documents\Visual Studio 2008\Projects\Pie_Rad_Trend\Pie_Rad_Trend\MainPage.xaml.cs 511 67 Pie_Rad_Trend

    How is this possible?

    Kind regards,

    Gertjan De Meyer
  7. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 22 Mar 2010 Link to this post

    Hello GJ DM,

    Could you confirm you are using the latest official version of the control (Q1 2010) as this property was only recently introduced and is not available in previous versions of the product?


    Regards,
    Freddie
    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.
  8. Grtjn
    Grtjn avatar
    129 posts
    Member since:
    Feb 2010

    Posted 22 Mar 2010 Link to this post

    Hi,

    I do not have the latest version, sorry for not pointing that out.

    Gertjan
  9. Grtjn
    Grtjn avatar
    129 posts
    Member since:
    Feb 2010

    Posted 23 Mar 2010 Link to this post

    Any solution for my version (Q3 - 2009) ?

    Kind regards,

    Gertjan
  10. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 25 Mar 2010 Link to this post

    Hi GJ DM,

    You need to simply delete the CornerRadius property setters and the application should work as expected with the Q3 2009 binaries.


    Kind regards,
    Freddie
    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.
  11. Grtjn
    Grtjn avatar
    129 posts
    Member since:
    Feb 2010

    Posted 29 Mar 2010 Link to this post

    Thanks for your reply Freddie.

    But still I can't get it working. But that's no problem here as it is not that necessary!

    Kind regards,

    Gertjan
  12. Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 29 Mar 2010 Link to this post

    Hi GJ DM,

    We are unsure why you are still experiencing problems with the Q3 2009 version -- please find attached a modified version of the sample application that behaves as expected in our local tests.


    Kind regards,
    Freddie
    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.
  13. Grtjn
    Grtjn avatar
    129 posts
    Member since:
    Feb 2010

    Posted 29 Mar 2010 Link to this post

    Hi,

    Both your applications do work. Sorry for not indicating that.
    The problem I'm experiencing is that, when I copy your code and try it in my application, I get a white screen when running.

    But as this numericindicator is no more needed in my project this is not a problem!

    Kind regards,

    Gertjan
Back to Top
DevCraft banner