![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
![]() |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#1
|
||||
|
||||
|
Componentes TMS
Esta va para quienes tengan los componentes de TMS...
Cual es el evento equivalente a DrawColumnCell en el TDBAdvGrid |
|
#2
|
||||
|
||||
|
OnDrawCell ....
![]()
__________________
Piensa siempre en positivo ! |
|
#3
|
||||
|
||||
|
Pero ese evento no se comporta igual ni tiene los mismos argumentos, habria que hacer muchos cambios al codigo...
|
|
#4
|
||||
|
||||
|
Hola.
Si quieres poner un color a una línea en particular según el valor de un campo, en el evento onGetCellColor escribes algo así :
Un saludo. |
|
#5
|
||||
|
||||
|
Gracias por responder, tengo codigo un poco mas elaborado...
Código:
procedure TForm3.jvdbgrd1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
var
r1, r2: TRect;
s1, s2: string;
const
clPaleGreen = TColor($CCFFCC);
clPaleRed = TColor($CCCCFF);
begin
if Column.Field.Dataset.FieldbyName('EXISTENCIA').AsInteger = 0 then
begin
if (gdFocused in State) then
jvdbgrd1.canvas.brush.color := clGray
else
jvdbgrd1.Canvas.Brush.Color := clSilver;
jvdbgrd1.Canvas.Font.Color := clBlack;
jvdbgrd1.DefaultDrawColumnCell(rect, DataCol, Column, State);
end
else
;
if Column.Field.Dataset.FieldbyName('EXISTENCIA').AsInteger > 0 then
begin
if (edt1.Text = '') or
(Pos(UpperCase(edt1.Text),
UpperCase(Column.Field.AsString)) <> 1) then
exit;
r1 := Rect;
r2 := Rect;
s1 := copy(Column.Field.AsString, 1, length(edt1.Text));
jvdbgrd1.Canvas.FillRect(Rect);
jvdbgrd1.Canvas.Font.Color := clRed;
jvdbgrd1.Canvas.Font.Style := [fsbold];
DrawText(jvdbgrd1.Canvas.Handle, PChar(s1), Length(s1), r1, DT_CALCRECT);
jvdbgrd1.Canvas.TextOut(r1.Left, r2.Top, s1);
jvdbgrd1.Canvas.Font.Assign(jvdbgrd1.Font);
s2 := StringReplace(Column.Field.AsString, s1, '', []);
r2.Left := r1.Right;
DrawText(jvdbgrd1.Canvas.Handle, pchar(s2), length(s2), r2, 0);
end
else
;
end;
![]() * La fila se pinta en Gris si la existencia es igual a 0. * Las filas con existencia mayor a 0 se pinta dinamicamente con lo que se va escribiendo en el Edt1. |
![]() |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| componentes | yevabas | Varios | 2 | 15-02-2011 18:17:25 |
| Componentes TCP/UDP | JPMMVR | Internet | 8 | 13-04-2009 19:12:49 |
| Componentes | nasedo | Varios | 6 | 11-02-2008 20:33:56 |
| componentes IBX | ARCON | Conexión con bases de datos | 3 | 25-10-2004 11:51:31 |
| Componentes XP | tgsistemas | OOP | 2 | 17-05-2004 14:28:08 |
|