Skip to main content
A newer version of this page is available. .

ASPxGaugeControl.Value Property

Gets or sets the ASPxGaugeControl’s value.

Namespace: DevExpress.Web.ASPxGauges

Assembly: DevExpress.Web.ASPxGauges.v20.2.dll

NuGet Package: DevExpress.Web.Visualization

Declaration

[DefaultValue("")]
public string Value { get; set; }

Property Value

Type Default Description
String String.Empty

A string value that specifies the control’s value.

Remarks

The ASPxGaugeControl’s value specifies the value or text of the first gauge found, contained within the ASPxGaugeControl.Gauges collection.

The value is calculated as shown below:

  • Digital

    IDigitalGauge dGauge = gaugeControl.Gauges[0] as IDigitalGauge;
    if (dGauge != null)
        value = dGauge.Text;
    
  • Circular

    ICircularGauge cGauge = gaugeControl.Gauges[0] as ICircularGauge;
    if (cGauge != null && cGauge.Scales.Count > 0)
        value = cGauge.Scales[0].Value;
    
  • Linear

    ILinearGauge lGauge = gaugeControl.Gauges[0] as ILinearGauge;
    if (cGauge != null && lGauge.Scales.Count > 0)
        value = lGauge.Scales[0].Value;
    
  • State Indicator

    IStateIndicatorGauge sGauge = gaugeControl.Gauges[0] as IStateIndicatorGauge;
    if (sGauge != null && sGauge.Indicators.Count > 0)
        value = sGauge.Indicators[0].StateIndex;
    

Example

This example demonstrates how to change the ASPxGaugeControl’s value using an ASPxSpinEdit.

Handle the spin editor’s ValueChanged event to call the gauge’s client-side ASPxClientGaugeControl.PerformCallback method. Pass the spin editor’s value as a parameter. As a result, the ASPxGaugeControl.CustomCallback event is raised, and the spin editor’s new value, specified by the e.Parameter property, is assigned to the ASPxGaugeControl.Value property. After a custom callback has been performed, the ASPxGaugeControl is automatically re-rendered.

The animation below shows the result:

gcCustomCallbacks

<dxe:ASPxSpinEdit runat="server" Number="0" Width="157px" Height="21px" ID="ASPxSpinEdit1">
    <ClientSideEvents ValueChanged="function(s, e) {
        gc.PerformCallback(s.GetValue());}">
    </ClientSideEvents>
</dxe:ASPxSpinEdit>
protected void ASPxGaugeControl2_CustomCallback(object source,
                  DevExpress.Web.CallbackEventArgsBase e) {
    ASPxGaugeControl2.Value = e.Parameter;
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Value property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also