A
acdc
Unregistered / Unconfirmed
GUEST, unregistred user!
有以下两个表格,用Table2.Artist来选择Table1中相应的数据:
Table1:
Artist | Album | ...
Table2:
ID| Artist|
程序中这样设置:
qry1.TableName:= 'Table1';
ds1.DataSet:= qry1;
EhGrid.DataSource:=ds1;
EhGrid.STFilter.Local:= True;
EhGrid.STFilter.Visibled:= True;
qry2.TableName:= 'Table2';
ds2.DataSet:= qry2;
...
EhGrid.FieldColumns['Artist'].STFilter.DataField:= 'Artist';
EhGrid.FieldColumns['Artist'].STFilter.Visibled:= True;
EhGrid.FieldColumns['Artist'].STFilter.ListSource:= ds2;
EhGrid.FieldColumns['Artist'].STFilter.ListField:= 'Artist';
EhGrid.FieldColumns['Artist'].STFilter.KeyField:= 'Artist';//'ID'
程序运行后,在Artist对应的列有下拉列表可选择,并不能过滤GRID中的数据,不知道是哪里设置不对,请指教。
Table1:
Artist | Album | ...
Table2:
ID| Artist|
程序中这样设置:
qry1.TableName:= 'Table1';
ds1.DataSet:= qry1;
EhGrid.DataSource:=ds1;
EhGrid.STFilter.Local:= True;
EhGrid.STFilter.Visibled:= True;
qry2.TableName:= 'Table2';
ds2.DataSet:= qry2;
...
EhGrid.FieldColumns['Artist'].STFilter.DataField:= 'Artist';
EhGrid.FieldColumns['Artist'].STFilter.Visibled:= True;
EhGrid.FieldColumns['Artist'].STFilter.ListSource:= ds2;
EhGrid.FieldColumns['Artist'].STFilter.ListField:= 'Artist';
EhGrid.FieldColumns['Artist'].STFilter.KeyField:= 'Artist';//'ID'
程序运行后,在Artist对应的列有下拉列表可选择,并不能过滤GRID中的数据,不知道是哪里设置不对,请指教。