What I love there, is, that I may sort colums by mouse-click as in Excel.
I wonder if that grid is intimately tires to IBX and interbase, or works with any information sources.
I did it with JvUltimGrid + UnifiedIB data acess.
The SQL query was modified and re-opened.
Took some coding, especially around corners, not documentedin VCL and cut in both grid and db lib. Specifically, it did not like when the query was changed in the middle of opening process, whe nthe windows was reading persisted customizations (the state user closed the window in last time).
As for the "i do it myself" - it can be both bad and good. It can be not very manageable and IF problem emerges it might be a blocker.
How should this query implement that sorting? Would it close the query, change SQL text and re-open it? Then what if it would make wrong edits to SQL text? or if SQL query has no immediate way to sort it (like UNIONs) ? Or other parts of the program did not expect anyone changing their query? Ot the changed query now is very slow and causes heavy load on the SQL engine ?
Also, when you open the same query again - the data might be different from results of the first opening. While refreshing is arguably good thing, it also might be confusing.
Or it was no SQL at all but some ORM, how to add sorting command then ? Object dataset (TList<TObject> with TDataSet interface to published properties) ?
DX's QuantumGrid comes with a number of adapters to different data sources and number of settings in them. Hopefully you would learn all those options :-)
Another way is to load the whole database into memory and sort it there. But, is it always possible? What if you run the program on a computer with 512MB memory (it was huge amount not so long ago) and the server is over the ocean and connection goes through slow 3G mobile phone? You click a header in a grid with like 40 rows (out of an actually large database) and expect nigh instant reaction. But the grid then starts sucking in the whole query. One hour later the program, after having downloaded 3 GB of data (your mobile provide is happy to make monthly bill to you), crashes by out-of-memory.
If you opt for this way of sorting, you better use some TMemoryTable or TClientDataSet - some component explicitly sayins all the results are in memory. So you would at least remeember it.
QuanmtumGrid really was very flexible, it supports sorting both locally after read-all and on-server by re-opening modified query. If there were a fitting adapter with fitting features. After yoiu learn how to choosethe adapter and how to set it up.
============
Oh, and BTW, can you mark some row in that grid, so their sorting would only be in one direction, not reversed one. So when a user makes multi-column sorting for other clumns he would be able to select ascendign or descending sort, but for these few the sorting would be always ascending or always descending ?
This was a very simple requirement and i was sure this uber-expensive uber-flexible grid from DevExpress has it. LOL. Eventually i had to patch DevExpress Quantum grid to have such a simple thing. When i asked vendor - they answered with a list of internal methods, that i had to cut out of their sources, modify them, and use my modified copy by calling from some grid's events instead of.
Basically, they just traced all the sorting sequence and gave me the list of methods that were used in it. Of help...
----
Basically, as long as you only need basic things - it is okay to use "out of the box" super-automated libraries. If you never would need anything above that, or if you sell it off early and if later comes a need to work with several years of accumulated data - it would be someone else's problem not yours. But you may happen on the other side too...
Othertimes, however, when you see some smartie automation you start thinking "in which condition it can break my program and render me responsible for their code". Especially if it was some other person which made some years ago that automated solution, of dozen grids and clientdatasets, connected via properties and almost no code, codeless programmer, trendy. It really worked great for 5 years, then it stopped. Maybe data accumulated too much, maybe some update was not ideally compatible. But all the properties are still there as they were, yet the magic does not happen. And you are ordered to fix it in few days, because the business can not do work.