It's possible to implement GridPanels in APEX in more than one way, with solutions varying from extremes of using almost no APEX functionality to relying mainly on APEX functionality.
An example of an "Almost no APEX" approach would be to create a plug-in region where you define the SQL query, and use no more standard APEX functionality. The solution would rely totally on the plug-in functionality written by you to manage the GridPanel.
Using the query, you could quite easily generate the datastore, the column headings based on the column aliases for the query. We have mostly written this already in Chapter 8, using the code for the ComboBox.
So, what about sorting and pagination? Okay, well ...