Skip to content

DevExpress-Examples/diagram-for-web-forms-linear-data-structure-how-to-bind-the-control-to-in-memory-data-sources

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Diagram for Web Forms - Tree from Linear Data Structure - How to bind the control to in-memory data sources

Unlike declarative DataSource controls (such as AccessDataSource, SqlDataSource, LinqDataSource, EntityDataSource, and so on), custom in-memory data sources (such as List<T>, DataTable and so on) do not allow you to automatically perform CRUD operations. These custom CRUD operations' logic can be implemented with the help of ObjectDataSource. This example demonstrates how to bind the ASPxDiagram control to ObjectDataSource and implement custom CRUD operations at the data source level.

In this example, the ASPxDiagram control transforms a linear data structure to a tree-like diagram. The NodeDataSourceID property specifies a bound data source. To transform a linear data structure to hierarchical, the data source should contain two additional fields:

  • The first field - assigned to the Key property and contains unique values.
  • The second field - assigned to the ParentKey property and contains values that indicate the current node's parent nodes.

You can bind other node settings to the data source. Assign field values to the corresponding settings in the Mappings.Node property.

Files to Review

More Examples