Removes columns not in dataset

Hi

I am having an issue where the tdbadvgrid is removing columns not present in the dataset.
What I am trying is to make a column selector where I can pick which of my predefined columns I want to see in the grid. Based on the selection I'll tag the columns to later hide the columns I don't want to see.
The tagged columns I then leave out of the search query for the db to save download (this is my primary objective).
But if the column is not present in the dataset the column automatically gets removed from the tdbadvgrid.

A few more facts:
- The TDBAdvGrid is setup to false on the following: AutoCreateColumns, AutoFilterUpdate, AutoNumAlign, AutoRemoveColumns, AutoSize, AutoThemeAdapt, just to mention a few.
- The TADOQuery does not have any defined fields.

I would think that it would be the AutoRemoveColumns, but again it is set to false.

Any help would be appreciated.

When AutoCreateColumns & AutoRemoveColumns are both set to false, the grid should not make any changes to the settings in grid.Columns nor add or remove any column. Are you using the latest version of the component? Are you referring here to an issue at designtime or runtime? When at runtime and the problem persists, please provide some sample source app with which we can reproduce this issue here.

I believe I am using the latest version (version 2.3.3.0 of TDBAdvGrid)
Here is a small example of what I am trying to do.
In AQTrans no fields have been defined.
In TDBAdvGrid I have defined columns with fieldnames even though they don't exists yet in the dataset (at designtime).
AutoCreateColumns & AutoRemoveColumns are both set to false.

When clicking button1 dataset refreshes and is viewed in grid.
When clicking button2 dataset refreshes and is viewed in grid but now "Timestamp", "Type", "Data" -columns are missing.



void __fastcall TForm1::Button1Click(TObject *Sender)
{
  AQTrans->Close();
  AQTrans->SQL->Clear();
  AQTrans->SQL->Add("SELECT TOP 100000");
  AQTrans->SQL->Add("   [Index]");
  AQTrans->SQL->Add("   ,[InsertTime]");
  AQTrans->SQL->Add("   ,[Timestamp]");
  AQTrans->SQL->Add("   ,[Type]");
  AQTrans->SQL->Add("   ,[Data]");
  AQTrans->SQL->Add("   ,[Volume]");
  AQTrans->SQL->Add("   ,[Amount]");
  AQTrans->SQL->Add("FROM [Transaction]");
  AQTrans->Open();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
  AQTrans->Close();
  AQTrans->SQL->Clear();
  AQTrans->SQL->Add("SELECT TOP 100000");

  AQTrans->SQL->Add("   [Index]");
  AQTrans->SQL->Add("   ,[InsertTime]");
  AQTrans->SQL->Add("   ,[Volume]");
  AQTrans->SQL->Add("   ,[Amount]");
  AQTrans->SQL->Add("FROM [Transaction]");
  AQTrans->Open();
}
//---------------------------------------------------------------------------

This looks logical to me as in your 2nd dataset there are no fields TimeStamp, Type, Data, so , your columns would still refer to unexisting fields in the 2nd dataset, hence display no data.

It's not that they are missing data, it is that the columns are completely missing from the tdbadvgrid columns collection. I agree that empty fields would be a logical result, and that would be what I was hoping for as this is what happens in the regular tdbgrid, but this is not what happens in tdbavdgrid.

If you check the columns collection you should see that it looses the columns completely.

I'd like to show a complete application source with the settings from design time also, I am just not sure how to upload it.

We have traced & solved this issue. Next update of TDBAdvGrid will address this.

Thank you :)
Thats great news.