windowsforms-devexpress-dot-xtradiagram-dot-diagramdatabindingcontrollerbase-ddfbab33.md
Gets or sets the data source for items.
Namespace : DevExpress.XtraDiagram
Assembly : DevExpress.XtraDiagram.v25.2.dll
NuGet Package : DevExpress.Win.Diagram
[DiagramCategory(DiagramCategory.Data)]
public virtual object DataSource { get; set; }
<DiagramCategory(DiagramCategory.Data)>
Public Overridable Property DataSource As Object
| Type | Description |
|---|---|
| Object |
An IEnumerable object that provides data to the DiagramDataBindingControllerBase.
|
The following code snippets (auto-collected from DevExpress Examples) contain references to the DataSource 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.
var model = new MainViewModel();
diagramOrgChartController1.DataSource = model.Contacts;
}
InitializeComponent();
diagramDataBindingController1.DataSource = ClassStructureGenerator.ClassList();
diagramDataBindingController1.ConnectorsSource = ClassStructureGenerator.ConnectionList();
How-to-bind-diagram-items-Position/CS/DXSample/Form1.cs#L15
diagramDataBindingController1.CustomLayoutItems += DiagramDataBindingController1_CustomLayoutItems;
diagramDataBindingController1.DataSource = viewModel.Items;
diagramDataBindingController1.KeyMember = "Id";
winforms-generate-diagram-with-grouped-items/CS/DiagramDataControllerBehavior/Form1.cs#L25
diagramDataBindingController1.GenerateConnector += DiagramDataBindingController1_GenerateConnector;
diagramDataBindingController1.DataSource = viewModel.Departments;
diagramDataBindingController1.ConnectorsSource = viewModel.Relations;
Dim model = New MainViewModel()
diagramOrgChartController1.DataSource = model.Contacts
End Sub
InitializeComponent()
diagramDataBindingController1.DataSource = ClassStructureGenerator.ClassList()
diagramDataBindingController1.ConnectorsSource = ClassStructureGenerator.ConnectionList()
How-to-bind-diagram-items-Position/VB/DXSample/Form1.vb#L15
AddHandler diagramDataBindingController1.CustomLayoutItems, AddressOf Me.DiagramDataBindingController1_CustomLayoutItems
diagramDataBindingController1.DataSource = viewModel.Items
diagramDataBindingController1.KeyMember = "Id"
winforms-generate-diagram-with-grouped-items/VB/DiagramDataControllerBehavior/Form1.vb#L27
AddHandler diagramDataBindingController1.GenerateConnector, AddressOf DiagramDataBindingController1_GenerateConnector
diagramDataBindingController1.DataSource = viewModel.Departments
diagramDataBindingController1.ConnectorsSource = viewModel.Relations
See Also
DiagramDataBindingControllerBase Class