Hi,
Is there any way that I can do the following?
1) Drop a web-gauge on a page
2) Select a style
3) Set it's value at run-time (i.e. where I want the needle to be set at) using 1-2 lines of C# code?
I can do steps 1 and 2, but I've been looking at the help for hours and all the examples either rely on you setting the needle at a static point (using the GUI) or creating the whole thing from scratch using code. I just want to drag and drop, then set the needle value at run-time using C#.
It's very frustrating that it's been made so complicated. Needles, brushes, markers, pens, scales... I know that this gives a lot of options, but I feel like you are practically asking us to create the whole guage ourselves from scratch. We may as well just learn System.Drawing ...
We bought the controls so that we can do cool things quickly. All the help files are rediculously long and complicated - surely there should simply be a "Max" "Min" and "Selected Value" property, for the 98% of us who just want to use the most popular 2% of the features?
Thanks
Alistair
I am assuming by Style you mean a preset. Here is step 3 for the Basic01 preset:
((RadialGauge)this.UltraGauge1.Gauges[0]).Scales[0].Markers[0].Value = 50;
One of the first things you have to do is access the Gauge you want to modify. I am indexing into the collection at the zero position. Then you have to cast it to the appropriate type (RadialGauge, LinearGauge, DigitalGauge). Depending on the hierarchy (you can look at the hierarchy in the designer), you have to get to the marker and set the value. This is going to be the same thign for the LinearGauge but for the DigitalGauge i believe you want to look for the Text property.
Thanks for the clear response!!! Worked prefect and got me over that initial learning curve.
The webgauge preset look great. How do I control the needle and other values during runtime? I'm using C#, and I am doing all the coding in a class for deployment to Sharepoint. I have no aspx page to drop the control in. I can load the preset and add it to Controls at runtime, but I don't know how to modify the values. So I tried to convert the preset to C#, but the gauge doesn't look right, and it take way too much time; especially if you're thinking about using several different gauge controls!
Can you show me how I'm supposed to work with the UltraGauge controls? Am I supposed to parse the Xml and update the tickmarks and such? I already tried the code on infragistics for the basic black gauge. I want the Blue Compas, and others like it. Not a flat black gauge. Thanks.