...Wie kann man ein Lookup Feld zur Laufzeit erstellen?
Autor: invisible
// example: create lookup field (string, size: 50) at runtime
with TStringField.Create(YourDataSet) do
begin
FieldName := 'FieldName';
FieldKind := fkLookup;
DataSet := YourDataSet;
Name := DataSet.Name + FieldName;
KeyFields := 'YourKeyFields';
LookupDataSet := YourLookupDataSet;
LookupKeyFields := 'YourLookupKeyFields';
LookupResultField := 'YourLookupResultField';
FieldDefs.Add(FieldName, ftString, 50, False);
end;
printed from
www.swissdelphicenter.ch
developers knowledge base