The Xafari platform supplies a number of tools for convenient work with the business objects that have tree-like hierarchical structure.
The following features are offered for such objects:
- Displaying the hierarchical structure in a List View using special editors: WinHierarhyNodeListEditor, ASPxHierarhyNodeListEditor and ASPxExplorerListEditor. HierarhyNodeListEditors represents a List Editor that displays data in the form of a tree-like structure.
- Support of multiple hierarchies. User can change a current hierarchy in the runtime.
To see the HierarchyNodeListEditor in action, refer to the Editors|IHierarchyNodeListEditor|XPOIHierarchy Node Object (or DCHierarchy Node Object) section in the Feature Center demo installed with Xafari.
HierarchyNodeListEditor allows the user to control the whole hierarchy in one list.
- User can change the subordination using Drag-and-Drop functionality in the runtime.
- Support of three deletion modes:
Default – deleting the object and all references to the object; in so doing, all child elements of the object become root elements.
Replacement – all child elements move up by one position in the hierarchy and end up in the parent's position when the node is deleted.
Cascade – deleting the object and all its child objects.
- One of the following three methods can be used to check whether child elements exist:
DirectDatabaseCount – makes request «Exists()» directly to the database.
CollectionCount - obtains a collection of child elements and compares the number of elements in the collection to zero.
Default – DirectDatabaseCount is used if no objects are edited, otherwise CollectionCount is used.
The objects that will be displayed via the HierarchyNodeListEditor must implement the IHierarchyNode or IHierarhyNodeEx interfaces (see an example in the FeatureCentеr). Xafari also provides HierarchyNodePersistentHelper service class for work with the objects implementing these interfaces.
To learn more about the HierarchyNodeListEditor, refer to the following document: