wwDBGrid settings to dynamically display view columns
Delphi 11.1. IP ver: 22.1.0.3
I have a wwDBGrid whose datasource is linked to a fdQuery component. the FDQuery runs a select from a MSSql View. I have 2 Calculated fields assigned to the FDQuery and these 2 fields are the only columns that show in the grid at runtime. The FDQuery has it's "fieldOptions" set to CombineComputed and the field objects for the FDQuery are dynamically created by the FdQuery.
I can manually Add columns to the wwDBGrid and all fields that are produced by the FDQuery are available.
I am trying to get the wwDBGrid to show all resulting fields in the grid even though they are not in the "Selected" property of the wwDBGrid at designtime. I would ultimately like to have the wwDBGrid restore the grid layout that was saved within the associated INI file and append any new columns to the end of the wwDBGrid.
I have the INIAttribues set to "CheckNewFields".
Are there wwDBGrid component settings that would allow for this behavior?
Thank you.
Dan
-
CheckNewFields is designed to add new fields that were previously not there. You would need usetfields=false. Not sure why it would not work in your case. You could try loading from the inifile yourself and then add the fields you want. Of course you would need to find a way to not do this on subsequent runs of your program.
-
Thanks Roy. I had the CheckNewFields set to true... I did not mention that I already had the useTFields set to False, I also have the INIAttributes -> Enabled set to False.
Is there some other setting I should be using? None of the "new" fields are showing up.
Are you suggesting that I could write the column settings to a Section in the INI file manually?
Thanks
Please sign in to leave a comment.
Comments
2 comments