How to use EHLIB to achieve automatic sorting

xiaoxiao2021-03-06  191

How to use EHLIB to achieve automatic sorting

Translation: nxyc_twz@163.com

??? Under the DataService folder of the EHLIB 2.6, some files that enable the data set automatically sorted. TDBGRIDEH uses the related objects in these files to achieve automatic sorting when the sort tag changes. ??? If you change the sort mark of the data grid and the title without writing an onsortmarkingchanged event, the data grid will try to automate data. DBGRIDEHDATASERVICE tries to find a specific object that can be sorted in TDataSet through getDataSetFeaSfordataset. As you know, TDataSet does not support data sorting, but its derived object TQuery or TclientDataSet allows you to achieve data sorting. Using Process RegisterDataSetFeatureseh, you can register with the TDataSetFeaSehclass class, which can be sorted for TQuery, TadoQuery, and TclientDataSet objects. Simply add EHLIB ... (EHLIBBDE, EHLIBADO, EHLIBCDS) of the unit to any unit of EHLIB ... (EHLIBDE, EHLIBADO, EHLIBCDS), and the data grid connected to them will automatically sort the data set. EHLIBBDE, EHLIBADO, EHLIBCDS are initialized by calling the RegisterDataSetFeatureseh process in the unit data set. For other dataset types, you must write and register new objects that can be sorted by this data set. Writing Process T [Your Data Set] DataSetFeatureseh.ApplySorting, you can access columns that use the SortMarkedColumns property to achieve direct ordering. You can view the samples in the DBUTILSEH unit to understand how to write T [your dataset] DataSetFeatureseh class and view Ehlibbde units to understand how to register T [your dataset] DataSetFeatureSeh class. Engine ?????????? Data set ?????????? unit file BDE ?????????? tQuery ?????????? ehlibbde? ADO ??????????? TadoQuery ??????? ehlibado? ClientDataSet? TclientDataSet ?? ehlibcds? DBEXPRESS ??????? ehlibdbxinterbase ????? express TibQuery EHLIBIBX

Translator Note:

In fact, implementing this feature is very simple (here I use BDE as an example to make automatic sorting):

1. Place a DBGRIDEH component on the form and connect it to the corresponding BDE dataset;

2. Set the DGAUTOSORTMARKING attribute in [Optionsen] of the component to true;

3. Double-click the component to add a related field in its pop-up attribute editor;

4. Set the titlebutton property of the [Title] of the [Title] of the list of the list of properties to be sorted;

5. Finally, don't forget to add EHLIBBDE units in the USES clause.

Ok, use the above way, you will find that the automatic sorting of data through EHLIB is actually as simple as it!

转载请注明原文地址:https://www.9cbs.com/read-128492.html

New Post(0)