How to remove a column


I'm using Delphi 10.2.3 (Tokyo), IW 15.0.17 and the last version of TMS controls.
In an application, I have in a form a table (TTIWDBAdvWebGrid) to show data obtained from a Query. Depending on the type of data to show, I need that my table have 4 or 5 columns. To do that, each time I have to show data I drop all columns and create new ones. To drop columns I use 2 different methods (for from ColCount-1 downto 0 do List.Columns.Delete;  and List.Columns.Clear), and the results are the same. The incorrect behaviour sequence is:
  1. Build the table with 4 columns --> OK
  2. Delete columns and Build the table with 5 columns --> OK
  3. Delete columns and Build the table with 4 columns --> NO OK. Shows 5 columns, and the contents of 5th column, comes from another table I have in same form.
In this last case, List.ColCount has the value of 4, even the form shows 5 columns.

Am I doing anything wrong? Could you tell me how to do to fix this problem?

Best regards,

           Venancio Lasquibar


Have you tried to set the AutoAddAllFields property to False?

Is set to false



I'm not sure what's causing the issue on your side.

Can you please check if the issue can be reproduced in a new project that only contains a TTIWAdvWebGrid component?

If so, please provide a ready to run sample project so I can review your code and further investigate this.