vamos a ver...
aquí dibujo el checkbox en el grid, dame tiempo para probar si puedo hacer un edit y un post, pero por lo pronto aquí la primera parte. 0=falso, cualquier otra cosa =verdadero.
Código Delphi
[-]
procedure TFrmInicial.DBGrid1DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
var
DrawState: Integer;
DrawRect: TRect;
begin
if (gdFocused in State) then
begin
if (Column.Field.FieldName = 'Campo') then
begin
CheckBox1.Left := Rect.Left + DBGrid1.Left + 2;
CheckBox1.Top := Rect.Top + DBGrid1.top + 2;
CheckBox1.Width := Rect.Right - Rect.Left;
CheckBox1.Height := Rect.Bottom - Rect.Top;
CheckBox1.Visible := True;
end
end
else
begin
if (Column.Field.FieldName = 'Campo') then
begin
DrawRect:=Rect;
InflateRect(DrawRect,-1,-1);
if column.field.asinteger=0 then
DrawState := DFCS_BUTTONCHECK
else
DrawState:= DFCS_CHECKED;
DBGrid1.Canvas.FillRect(Rect);
DrawFrameControl(DBGrid1.Canvas.Handle, DrawRect,
DFC_BUTTON, DrawState);
end;
end;
end;