function GetDGridInputText(Grid: TDBGrid): string; var I: Integer; Edit: TCustomEdit; begin Result := ''; for I := 0 to Grid.ComponentCount - 1 do if Grid.Components[I] is TCustomEdit then begin Edit := TCustomEdit(Grid.Components[I]); if Edit.Visible and Edit.Focused then begin Result := Edit.Text; break; end; end; end;
var
I: Integer;
Edit: TCustomEdit;
begin
Result := '';
for I := 0 to Grid.ComponentCount - 1 do
if Grid.Components[I] is TCustomEdit then
begin
Edit := TCustomEdit(Grid.Components[I]);
if Edit.Visible and Edit.Focused then
begin
Result := Edit.Text;
break;
end;
end;
end;