GaugeExportContext Class

Provides a connection between data item containers from the Gauges section and underlying control’s gauges during export.

Namespace: DevExpress.DashboardCommon

Assembly: DevExpress.Dashboard.v21.2.Core.dll

Declaration

public class GaugeExportContext :
    ControlContext

Remarks

Use the XRDashboardGauge object to customize the printable gauges.

The following image illustrates elements of the printable gauge:

Example

The following example illustrates how to customize the Gauge dashboard item in the exported document when you handle the DashboardDesigner.CustomExport / DashboardViewer.CustomExport events. You can use the CustomExportEventArgs.GetPrintableControls method to obtained the printable controls.

using DevExpress.DashboardCommon;
using DevExpress.DashboardWin;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;

private void DashboardControl_CustomExport(object sender, CustomExportEventArgs e) {
  foreach(var printControl in e.GetPrintableControls()) {
    if(printControl.Value is XRGaugeDashboardItem) {
      var gaugeItemName = printControl.Key;
      DashboardDesigner designer = (DashboardDesigner)sender;
      var gaugeDashboardItem = designer.Dashboard.Items[gaugeItemName] as GaugeDashboardItem;
      foreach(var dashGaugeElement in gaugeDashboardItem.Gauges) {
        foreach(var gaugePanel in e.GetGaugeContext(gaugeItemName).GetPrintableGauges(dashGaugeElement).Cast<XRDashboardGauge>()) {
          if(gaugePanel != null) {
              gaugePanel.MainSeriesLabel.ForeColor = Color.Red;
          }
        }
      }
    }
  }
}

Inheritance

Object
ControlContext
GaugeExportContext
See Also