This is a migrated thread and some comments may be shown as answers.

Numberindicator

11 Answers 73 Views
Gauge
This is a migrated thread and some comments may be shown as answers.
Grtjn
Top achievements
Rank 1
Grtjn asked on 12 Mar 2010, 12:15 PM
Hi,

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

Kind regards,

Gertjan

11 Answers, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 12 Mar 2010, 04:12 PM
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.
0
Grtjn
Top achievements
Rank 1
answered on 15 Mar 2010, 09:05 AM
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
0
Giuseppe
Telerik team
answered on 18 Mar 2010, 11:45 AM
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.
0
Grtjn
Top achievements
Rank 1
answered on 19 Mar 2010, 09:26 AM
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
0
Giuseppe
Telerik team
answered on 22 Mar 2010, 12:21 PM
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.
0
Grtjn
Top achievements
Rank 1
answered on 22 Mar 2010, 01:17 PM
Hi,

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

Gertjan
0
Grtjn
Top achievements
Rank 1
answered on 23 Mar 2010, 08:39 AM
Any solution for my version (Q3 - 2009) ?

Kind regards,

Gertjan
0
Giuseppe
Telerik team
answered on 25 Mar 2010, 02:05 PM
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.
0
Grtjn
Top achievements
Rank 1
answered on 29 Mar 2010, 07:59 AM
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
0
Giuseppe
Telerik team
answered on 29 Mar 2010, 09:08 AM
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.
0
Grtjn
Top achievements
Rank 1
answered on 29 Mar 2010, 10:28 AM
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
Tags
Gauge
Asked by
Grtjn
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Grtjn
Top achievements
Rank 1
Share this question
or