Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Collapse]Gauges
   [Expand]Getting Started
   [Expand]Concepts
   [Expand]Design-Time Features
   [Collapse]Examples
     How to: Add and Customize Gauge Animation
     How To: Bind a Gauge Control to a Data Source
     How to: Bind a Gauge Control to a Data Source at Runtime
     How to: Create a Circular Gauge (Design-time)
     How to: Create a Circular Gauge (Runtime)
     How To: Create a Digital Gauge (Design-time)
     How To: Create a Digital Gauge (Runtime)
     How To: Create a Gauge From Scratch (Runtime)
     How To: Create a Linear Gauge (Design-time)
     How To: Create a Linear Gauge (Runtime)
     How To: Create a State Indicator Gauge (Design-time)
     How To: Create a State Indicator Gauge (Runtime)
     How To: Custom Draw a Gauge Control
     How to: Move Value Indicators at Runtime
     How To: Use Gauges for In-Place Editing
   [Expand]Product Information
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How To: Bind a Gauge Control to a Data Source

This sample shows how to data-bind the text of a digital gauge to a field in the NWind database at design time.

At design time, you can data-bind the DigitalGauge.Text property to the NWind database via the Properties grid or the gauge's designer.

To bind via the Properties grid, locate the DigitalGauge.Text property in the DataBindings section. Then, open the dropdown for this property and select the data source you would like to bind to the property.

Let's consider how to bind the text of a digital gauge to the NWind database via the gauge's designer in more detail.

To bind to a property via the gauge's designer, first open the designer by selecting a gauge object on the form and selecting the Run Designer option from the gauge's tag menu.

  • In the designer that opens, switch to the Data Bindings page and select the Add Project Data Source... option.

    The Data Source Configuration Wizard appears. It allows you to select a data source.

  • In the Wizard's first page, select the Database icon and click Next.

  • On the Choose your Data Connection page, click New Connection and specify the path (C:\Users\Public\Documents\DevExpress Demos 17.2\Components\Data\nwind.mdb) to the NWind database file (leave the Password option blank). Then, you may use the Test Connection option to test data source availability.

    To proceed, click Next.

  • Click Next on the following page to save the created connection string to the configuration file.

  • Now, choose the tables containing information required for the gauge. Select the Products -> UnitPrice table as shown below and click Finish.

  • Run the application to see the result.

To learn more about Gauge Control data-binding, see Data Binding.

How would you rate this topic?​​​​​​​