|
Data binding. Get started
Sunday, 01 August 2010
Besides filling the treeview manually, Flexible TreeView allows filling it from the external data source including hierarchical as well as the plain one. The following types of data source are supported:
Flexible TreeView supports both one-way and bidirectional (two-way) binding modes. Bidirectional binding mode allows to synchronize the changes of the treeview and data source without writing a single line of code. DataBindingAll of the settings for binding data can be found in the DataBinding treeview property which includes the following options:
In order to bind data you need to point to your data source in the DataSource property: tree.DataBinding.DataSource = list; If you already pointed to your data source earlier, then made changes to it from the outside and want to refresh the treeview, call method DataBinding.Refresh.
Flexible TreeView supports two modes for working with data source – bound and unbound. If the unbound mode is on, nodes of the treeview will store in themselves data of the bound objects. At the same time during edit of the data in the treeview, the data source wouldn`t be renewed. In order to turn on this mode set the value of the BoundMode property to FALSE.
By default (BidirectionalMode = false), Flexible TreeView does no actions if the treeview structure or data source has been changed (a node has been added or deleted), i.e. the one-way data binding mode is activated.
Flexible TreeView supports binding of the plain data sources as well as the hierarchical ones. Note, that if a KeyFieldName and ParentFieldName are filled, Flexible TreeView will not show these properties in the treeview!
By default, user can edit data after binding. You can deny editing of the data by setting value of the ReadOnly property to TRUE.
During binding of the data source all of the public properties (as columns and node controls) and objects (as nodes) located in the data source will be added to the treeview. Flexible TreeView will also let you perform a validation of these added to the treeview objects. In order to perform this task, turn on the Validate property of the DataBinding object and subscribe to the ColumnPopulating, NodeControlPopulating and NodePopulating events. See the Data binding inspection topic for details.
|
|