Hallo!
Das problem ist, daß Funktion was du vorgeschlagen hast, wird leider NIE vom Fields Editor aufgerufen...
Alles was Fields Editor manipuliert ist DataSet.FieldDefs!
Delphi-Quellcode:
// auszug aus dem TFieldsEditor
function TFieldsEditor.DoAddFields(All: Boolean): TField;
var
AddFields: TAddFields;
I: Integer;
FieldName: string;
Field: TField;
begin
CheckFieldAdd;
Result := nil;
try
DSDesigner.BeginUpdateFieldDefs;
DataSet.FieldDefs.Update;
finally
DSDesigner.EndUpdateFieldDefs;
end;
AddFields := TAddFields.Create(Application);
try
{ Add physical fields not already represented by TField components to the
to the list of available fields }
for I := 0 to DataSet.FieldDefList.Count - 1 do
with Dataset.FieldDefList[I] do
if (FieldClass <> nil) and not (faHiddenCol in Attributes) then
begin
FieldName := DataSet.FieldDefList.Strings[I];
Field := DataSet.FindField(FieldName);
if (Field = nil) or (Field.Owner <> Dataset.Owner) then
AddFields.FieldsList.Items.Add(FieldName);
end;
{ Show the dialog }
AddFields.SelectAll;
AddFields.FieldsList.ItemIndex := 0;
{$IFDEF MSWINDOWS}
if All or (AddFields.ShowModal <> mrCancel) then
Result := CreateFields(AddFields.FieldsList);
{$ENDIF}
finally
AddFields.Release;
end;
end;
Grüße, Zsoca