CRDBGrid: "Lookup" and sorting possible?

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Guest

CRDBGrid: "Lookup" and sorting possible?

Post by Guest » Wed 27 Apr 2005 17:43

Hi,

as I know from the forum, CRDBGrid does not allow sorting on lookup fields. How can I achieve a similar behaviour?
I have a main table with several foreign keys to lookup tables. I want to display a grid which shows the rows from the main table, where the foreign keys are resolved to the describing text from the lookup tables (eg. employee name instead of ID). This can be done by a Query which joins the tables. But now there is no DropDown-editor in the grid for the "lookup" columns. I can't change data or insert new records. Is there any possibility?

I also thought of using DBCtrlGrid and showing my own kind of grid. But then I can't use the nice built-in features of CRDBGrid like sort, filter and column sizing.

Thanks,
Thomas

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Fri 29 Apr 2005 13:32

As to DropDown-editor try to use TCRDBGrid.Columns.PickList property and set it to appropriate values. For more info see "PickList property (TColumn)" topic in Delphi help.
Also you should write all Update SQLs (insert, delete, update ) manually to allow editing of your dataset. For more info see "Updating data with ODAC dataset components", "TCustomDADataSet.SQLUpdate", "TCustomDADataSet.SQLInsert" topics of ODAC help.

Post Reply