Jump to content
Software FX Community

Format guage


John1grid

Recommended Posts

Especially because I still cannot configure the grid using visual studio designer, due to a control error, I need to do things in program code.

 For example I want to set up a column with a circular guage and another with a traffic light.

The only program example I could find anywhere shows only how to do a linear guage:

http://support.softwarefx.com/SupportDocTree.aspx?Prod=GridFX10&Type=P

It looks like the NumberFormatter may be the solution but I see no guidance or examples on how to link it to a column with a guage.

Link to comment
Share on other sites

In regards the sample that shows how to add a Radial Gauge, you can find a full VS2005 sample installed with Grid FX called "RealEstate", in that sample open the form called "Layout_Gauges". There you will find the following:

// a NumberField object is cast as grid amount field

GridFX.WebForms.NumberField numField = (GridFX.WebForms.NumberField)Grid1.DataFields["amount"];

// Default display setting is changed to Gauge

numField.Format.Display = GridFX.WebForms.NumberDisplayType.Gauge;

// Let's show a radial gauge

ChartFX.WebForms.Gauge.RadialGauge Gauge1 = new ChartFX.WebForms.Gauge.RadialGauge();

// Let's create a RadialScale object, later used to add sections to the gauge

ChartFX.WebForms.Gauge.RadialScale radialScale1 = new ChartFX.WebForms.Gauge.RadialScale();

// INCLUDE HERE YOUR settings to personalize your Gauge

ChartFX.WebForms.Gauge.Section gSection1 = new ChartFX.WebForms.Gauge.Section();

gSection1.Bar.Color = System.Drawing.Color.FromArgb(124, 252, 0);

gSection1.Max = 280000;

gSection1.Min = 0;

// VERY IMPORTANT LINE

//Let's format the gauge with all previously customized attributes (Section/Indicator/needle/RadialScale)

numField.Format.Gauge = Gauge1;

Please post a screen shot with the control error you mentioned.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...