Ver Mensaje Individual
  #3  
Antiguo 20-12-2006
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - Espańa
Posts: 18.278
Reputación: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Cita:
Empezado por neosyoshiran
...si existe un registro en el DBGRID solo que aparescan los botones MODIFICAR, BORRAR activado los demas desactivados.
Debes preguntar no al DBGrid, sino al DataSet asociado. Puedes usar las propiedades BOF y EOF.

Código Delphi [-]
var
  Empty:Boolean;
begin
  empty := (DBGrid.DataSet.EOF) and (DBGrid.DataSet.BOF);
  Nuevo.Enabled := empty;
  Modificar.Enabled := not empty;
  Borrar.Enabled := not empty;

AzidRain te ha mostrado el camino, pero BOF sólo te dice si estás al principio o no, nada de si está vacío o con registros.
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita