1

I',m trying to use some ADT subfields added in a TFDQuery in a TcxGrid. When i add a column using a subfield from a ADT Field, the column don't show the field value and the field is Ready Only. How to use correctly this field type in a cxgrid?

how to reproduce:

  1. Create a table in database like (i'm using Postgres):

    create table test (id integer, name text);

  2. In Delphi, Create a TFDQuery with a SQL text:

    select test from test

  3. Add the ADT field (test) in Field Editor. So, test.id and test.name will be created as individual fields too.

  4. Then add a TcxGrid in a form and create a Tableview adding the FDQuery's columns of step 3 (you can't do it automaticaly by "Retrieve Fields" Option on gridview editor).

  5. The issue: columns don't shows the field value, but the ADT column (test) like a record values

Ps: Using TDBGrid can show and edit the individual columns, but i need to use TcxGrid.

AnselmoMS
  • 467
  • 3
  • 18
  • I doubt this q is answerable unless you provide an [mcve](https://stackoverflow.com/help/mcve) to show what you are attempting, including some data which is used to populate the database table(s) which the FDQuery queries to create the ADT field. – MartynA Oct 16 '18 at 17:43
  • @MartynA Thanks. mvce added – AnselmoMS Oct 16 '18 at 18:21

1 Answers1

3

If you want show subfields of the ADT field as individual columns, the TFDQuery.ObjectView property must be set to false (Displaying_ADT). In this way, you can automatically or manually add the subfields present in the ADT field, and additionally, edit them individually in the TcxGrid.