...Wie kann man ein Lookup Feld zur Laufzeit erstellen?
|
Autor:
invisible |
[ Tip ausdrucken ] | | |
// 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;
Bewerten Sie diesen Tipp:
|
|
|