wwDBGrid not properly displaying columns whendataset of wwDataSource changes
I have an application that utilizes several wwDBGrids. These grids are all linked to the same wwDataSource. The wwDatasource has a FDQuery as its Dataset. I have 2 Calculated Persistent fields for the FDQuery but no other persistent fields are created.
The problem arises when I change the query which produces a resultset that has a field that is not contained in the other query results. I have the "Fieldoptions" on the FDQuery set to "acCombineComputed" (I have also tried the "acCombineAlways" setting and it fails as well).
I setup the wwDBGrid in design mode to include the "extra" field. The "UseTFields" set to False on the wwDBGrid. As stated before, I am not creating persistent fields for the Dataset because the fields may change on the query.
When I run the application, the Extra field is not contained in the wwDBGrid and the other Columns of the wwDBGrid are not retaining the Order or Size that are established in design mode.
What are the settings for the Dataset and the wwDBGrid that would allow for storing of the Column settings that would allow for the dynamic use of the FDQuery.
Thanks for the help.
Hello, I thought I would try to use the "RestoreDesignSelected" method after I open the FDQuery in an attempt force the grid to display the proper columns... (again, the twwDBGrid1 and twwDBGrid2 are linked to the same twwDataSource and the twwDatasource is linked to the same TFDQuery only the ResultSet from the TFDQuery changes).
Using the RestoreDesignSelected is having No effect on the grid's columns. The wwDBGrid2 shows all the columns in the resultset Except the "Extra" field noted above. Plus, wwDBGrid2 shows no column formatting or positioning as defined in the design of the wwDBGrid.
I tried to review the Help for the wwDBgrid control and there isn't any additional information.
Is there some reason why 2 grids with different column definitions cannot be associated with the same twwDataSource but maintain separate Column layouts? Any other suggestions?
Please sign in to leave a comment.