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
CRDBGrid: "Lookup" and sorting possible?
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.
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.