[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Collapse]Diagram Control
    Getting Started
   [Expand]Diagram Control
   [Expand]End-User Interaction
   [Expand]Diagram Items
   [Expand]Automatic Layout
   [Collapse]Data Binding
     Generating Diagrams from a Data Source
     Generating Organization Charts
     Item Template Designer
    Themes and Styles
    Printing and Exporting
    Saving and Loading Diagrams
   [Expand]Examples
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Generating Diagrams from a Data Source

The DiagramDataBindingBehavior class provides the data binding behavior for the DiagramControl. To bind the DiagramControl to data, open its Smart Tag panel and select DiagramDataBindingBehavior.

The following XAML will be generated.

To configure the data source, go to the Smart Tag panel's MVVM Behaviors tab.

The following table lists the properties used to map a diagram to data.

Member Description
DiagramDataBindingBehaviorBase.ItemsSource Specifies the path to a collection of diagram items.
DiagramDataBindingBehavior.ConnectorsSource Specifies the path to a collection of objects that represent connectors.
DiagramDataBindingBehavior.ConnectorFromMember Specifies the name of the data field that identifies the item to use as a connector's start item.
DiagramDataBindingBehavior.ConnectorToMember Specifies the name of the data field that identifies the item to use as a connector's end item.
Note

Limitations The DiagramDataBindingController can only get values from strongly typed objects. Binding to dynamic properties is not supported.

Tip

The Item Template Designer allows you to design templates for diagram items and connectors at design time.

The following example demonstrates the DiagramControl bound to sample data.

Is this topic helpful?​​​​​​​