Introduction To Provider Mode
- 2 minutes to read
This topic describes the basics of persisting data with the custom data source.
In provider mode, the data can be processed in one of two ways:
TcxTreeListCustomDataSource-managed data manipulation. You implement your own descendant of the TcxTreeListCustomDataSource class, and override certain callback methods (at least, methods that implement the basic functionality – data identity and data exchange). This solution provides two possible strategies depending on whether a tree list uses the smart load or not. For the enabled smart load feature, you implement additional methods that control a data partial load. To learn how to implement this mode via overriding, refer to the Example: TreeList Provider Mode help topic and the ExpressQuantumTreeList Features and ProviderModeDemo demos.
Event-managed data manipulation. No subclassing of the TcxTreeListCustomDataSource is required for this type of data manipulation. The built-in custom data source instance is used instead. You only handle the tree list’s OnGetChildCount, OnGetNodeValue and OnSetNodeValue events. The rest is provided by the control. For the example, refer to the VirtualModeDemo that is shipped with the product.
These approaches are exclusive, and cannot be interspersed with each other. The tree list’s data controller automatically recognizes which custom data source is currently used, and dispatches method calls to the target data source instance.
Multi-Threading Support
To enable support for multi-threaded data processing in your thread-safe TcxCustomDataSource descendant, override its IsMultiThreadingSupported function to return True
.