Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #3  
Antiguo 24-06-2017
petercat petercat is offline
Miembro
 
Registrado: feb 2012
Posts: 23
Poder: 0
petercat Va por buen camino
Gracias mallet, pero el componente TAdvStringGridveo que es de pago y ya me he hecho yo mi procedure para que me funcionelo pongo aqui por si a alguien le hace falta.
Cuento las lineas de grid que tengo [T], [i] es otro integer que yo utilizo un numero determinado, y [H] es una division que utilizo para pintar la linea por debajo.
Realmente lo que conseguimos es pintar todo el cuado del grid en color ClBlack y lo reducimos por arriba utilizando (MyRect.Bottom := MyRect.Top + 3y por abajo (MyRect.Top := MyRect.Bottom - 3) las variables T,I,H son donde quiero hacer el recuadro, tambien los podemos ace en el ColLines con (Column.Index) donde 1 puede ser una variable mas.

Código Delphi [-]
type
  MyTDBGrid = class(TDBGrid);

procedure TFTecladoDetalle.DBGrid1DrawColumnCell(Sender: TObject;
  const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);
var
  MyCanvas: TCanvas;
  MyColor: TColor;
  MyRect: TRect;
  T, i,h :Integer;

begin
T := DBGrid1.DataSource.DataSet.RecordCount;
I :=4;
H := T div I;


  if Column.Index mod 1 = 0 then begin
    MyCanvas := DBGrid1.Canvas;
    MyColor :=  DBGrid1.Canvas.Brush.Color;
    DBGrid1.Canvas.Brush.Color := clblack;//DBGrid1.Color;
    MyRect := Rect;
//    Inc(MyRect.Right); // QUITO EL COLLINES EN EL GRID Y COMENTO ESTO
    MyRect.Left := MyRect.Right - 3;  //GROSOR DE LA LINEA
    MyCanvas.FillRect(MyRect);
    if MyTDBGrid(DBGrid1).DataLink.ActiveRecord mod H = 0 then begin

      MyRect := Rect;
//      Inc(MyRect.Bottom); // QUITO EL ROWLINES EN EL GRID Y COMENTO ESTO
      MyRect.Bottom := MyRect.Top + 3;  //GROSOR DE LA LINEA
      MyCanvas.FillRect(MyRect);
    end;
    if MyTDBGrid(DBGrid1).DataLink.ActiveRecord mod T = T-1 then begin
      MyRect := Rect;
//      Inc(MyRect.Bottom); // QUITO EL ROWLINES EN EL GRID Y COMENTO ESTO
      MyRect.Top := MyRect.Bottom - 3;  //GROSOR DE LA LINEA
      MyCanvas.FillRect(MyRect);
    end;
    DBGrid1.Canvas.Brush.Color := MyColor;
  end;


end;
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Contador en una DbGrid para contar casillas BuRtOn Varios 7 09-07-2008 22:36:44
excel a delphi, como mostrar columnas de excel Vyckso Servers 2 13-08-2007 12:38:08
como mandar un dbgrid a una hoja de excel de solo lectura ddd_ddd Varios 1 06-09-2006 20:05:10
Colorear casillas de un stringrid igest2000 Varios 0 27-01-2006 11:34:39
Como limpiar las casillas del DBCheckBox? gersongelabert Conexión con bases de datos 1 08-01-2005 08:44:34


La franja horaria es GMT +2. Ahora son las 14:57:15.


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
Copyright 1996-2007 Club Delphi