Hola,
he conseguido solucionar el problema verificando si el Grid asociado al DataSet tiene la propiedad Showing a True. De esta forma cuando el programa se encuentre dentro del código de OnCreate y todavía no se este mostrando el Grid no ejecutará la instrucción DisableControls.
Código para obtener el Grid asociado al DataSet:
Código Delphi
[-]function GetGridAsociado: TDBGrid;
var
I: integer;
begin
Result := nil;
for I := 0 to Owner.ComponentCount - 1 do
if Owner.Components[i] is TDBGrid then
if TDBGrid(Owner.Components[i]).DataSource <> nil then
if TDBGrid(Owner.Components[i]).DataSource.DataSet = Self then
begin
Result := TDBGrid(Owner.Components[i]);
Break;
end;
end;
Código para comprobar si se está mostrando el Grid:
Código Delphi
[-]if GetGridAsociado.Showing then
Self.DisableControls;
No dudéis en realizar cualquier comentario sobre el código, muchas gracias por las respuestas, me han hecho ir en la dirección correcta.
Un saludo