I have one table that has two lookup columns. I've tried reverting to regular data columns with the same result. One other Master/Detail grid on the same form has the same issue. I'm using TUniQueries.
Here is the SQL Query from the table having the issue...
Code: Select all
procedure TAdobeLicenseInfo.SetAdobeKeyTBLtoAllRecords;
begin
With UQAdobeKeyTBL do
begin
SQL.Text := 'SELECT * from AdobeKeyTBL ORDER BY AdobeLicIDNo';
Active := True;
end;
end;
[code]
.......Here is the SQL Statement from the the first detail table which holds the value for the AdobeLicIDNo column.
[code]
procedure TAdobeLicenseInfo.SetAdobeProductTBLtoFilteredRecords;
begin
With UQAdobeProductTBL do
begin
MasterSource := UDSAdobeLicTBL;
MasterFields := 'AdobeProductIDNo';
SQL.Text := 'SELECT * from AdobeProductTBL WHERE AdobeProductIDNo = :AdobeProductIDNo ORDER BY AdobeProductName';
Active := True;
end;
end;
Now here is the kicker....
When the form is shown, there are three records total within the AdobeKeyTBL. Nothing is filtered. Within the two lookup columns, having the first record selected, the two values are there. It looks like this...
(Sorry, four columns, first two are the fkLookups, formatting doesn't hold...)
Adobe License ID No Key Type Column4 Column5
1 Cloud Based dataisthere dataisthere
NOTHING HERE NOTHING HERE dataisthere dataisthere
NOTHING HERE NOTHING HERE dataisthere dataisthere
There *is* data in the 2cd and third record but it is not showing.
If you move to the next record, it still shows only the first record data, however if you click the dropdown box in the column in dsBrowse, the data is listed there, but you cannot select it. This goes for where there is no data showing in the second and third rows. It's still blank in the showing cell.
So I did a test where I made invisible the fkLookup fields and put the data fields back for the respective fields. Same issue, so it doesn't seem to be how the TDBGrid is showing it. I have all fields set persistently in the column editor btw.
If you place the dataset into insert mode, a new row is inserted and you are able to select your data but the other rows are still showing as above. So now you change your mind and hit cancel and ALL THE DATA IS SHOWING. As below...first two columns are the fkLookup columns.
Adobe License ID No Key Type Column4 Column5
1 Cloud Based dataisthere dataisthere
5 Key Based dataisthere dataisthere
6 Key Based dataisthere dataisthere
Now, when you hit the refresh key for the dataset, if the cursor is on the first row, it goes back to what it looked like when the form was shown. If the cursor is on the second row, it will show like below....
Adobe License ID No Key Type Column4 Column5
NOTHING HERE NOTHING HERE dataisthere dataisthere
5 Key Based dataisthere dataisthere
NOTHING HERE Key Based dataisthere dataisthere
This is totally consistent with the records every time. I have tried repainting the grid, deleting and re-adding the TUniQueries and TUniDatasets, adding the persistant fields to both the data components and rebuilding the TDBGrids.
What am I missing here...if refreshing the database does this and the DBGrid only shows what it's handed, are we dealing with a little problem or am I doing something wrong?
Thanks...
Steve