Icon View Incident Report

Serious Serious
Reported By: Dhanashree Pathak
Reported On: 10/24/2007
For: Version 1.05 Build 2
# 2465 A Filter on the Detail Table in a Master-Detail Link Do Not Refresh Properly When Master Moves

Please check this issue. We are facing problem of record not getting displayed in the grid connected to Detail table, when we put a Filter on Detail table.

When we open both the table the master detail works fine. Then we set the following filter in the Detail table

tblDetail.filter := '((not (term in (2,7,8)))) and (charges = 0)';
tblDetail.filtered := true;

This works fine for the record that is pointed by the Master table (Detail grid shows the records properly). When i move to the next Master record and it Does Not show me any records in Detail.

Master Table
---------------------------

Key           Value
------------------------------
1                First  
3                Third

 
Detail Table
------------

MainKey   DetailPrimaryKey   Value         term    charges
-----------------------------------------------------------
1                      1     First           0        0
1                      2     First           2        0 
3                      3     Third           0        0
3                      4     Third           2        0 

Detail table is connected to master as follows

Detail Table - MasterSource points to Master Table
Detail Table - MasterFields = Key
Detail Table - IndexFields = MainKey in Detail table

We have Primary Key - DetailPrimaryKey
we have Index on MainKey

Connect Master table to dbgrid1 -> DataSource1 -> tblMaster
Connect Detail Table to dbgrid2 -> DataSource2 -> tblDetail



Comments Comments and Workarounds
The workaround is to put the following in the AfterScroll event for the master table:

You should
use something like this:

procedure TForm1.EDBTable1AfterScroll(DataSet: TDataSet);
begin
with DetailEDBTable do
begin
Filtered:=False;
Filter:='((not (term in (2,7,8)))) and (charges = 0)';
Filtered:=True;
end;
end;


Resolution Resolution
Fixed Problem on 10/26/0207 in version 1.06 build 1


Products Affected Products Affected
ElevateDB VCL Client-Server
ElevateDB VCL Client-Server with Source
ElevateDB VCL Standard
ElevateDB VCL Standard with Source
ElevateDB VCL Trial

Image