Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   OOP (https://www.clubdelphi.com/foros/forumdisplay.php?f=5)
-   -   Dbgrid y Multiselect (https://www.clubdelphi.com/foros/showthread.php?t=20817)

jorge_mosquera 26-04-2005 18:48:50

Dbgrid y Multiselect
 
Hola, si tengo habilitado un dbgrid con la opcion Multiselect, como hago para marcar o desmarcar automaticamente todos los registros ?
Muchas gracias

marcoszorrilla 26-04-2005 20:11:06

Código Delphi [-]
 function GridSelectAll(Grid: TDBGrid): Longint; 
 begin 
   Result := 0; 
   Grid.SelectedRows.Clear; 
   with Grid.Datasource.DataSet do 
   begin 
     First; 
     DisableControls; 
     try 
       while not EOF do 
       begin 
         Grid.SelectedRows.CurrentRowSelected := True; 
         inc(Result); 
         Next; 
       end; 
     finally 
       EnableControls; 
     end; 
   end; 
 end;

Un Saludo.

jorelivi 25-04-2007 19:24:52

Como actualizo los registros seleccionados en un dbgrid
 
Espero su ayuda para solucionar este problemita, pues no se como actualizar los registros ya seleccionados de un dbgrig. Este dbgrid solo actualiza un campo fecha.

LordRiper 26-04-2007 03:22:41

Código Delphi [-]
  
if Lista.SelectedRows.Count>1 then  // por si solo seleccionan uno...
   for I := 0 to Lista.SelectedRows.Count-1 do
   begin
     Table.BookMark := Lista.SelectedRows[i];
     // Todo lo que tengas que hacer
   end
else
  // Todo lo que tengas que hacer


La franja horaria es GMT +2. Ahora son las 10:43:25.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi