Ver Mensaje Individual
  #2  
Antiguo 17-11-2004
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.289
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 fmonte
Me muestra la palabra MEMO en ves de mostrarme la informacion
No es muy complicado hacer que se sustituya el contenido del memo por el texto (MEMO) que ves ahora; Para ello puedes utilizar el evento OnDrawColumnCell del DBGrid; Se lee el memo y se repinta la celda con el texto; También puedes eliminar los saltos de línea si te molestan para mostrar todo el memo seguido.

Aquí tienes un pequeño ejemplo de cómo hacerlo.

Código Delphi [-]
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
  DataCol: Integer; Column: TColumn; State: TGridDrawState);
var
  Str: string;
begin
  // es la columna de memo?
  if (Column.Index = 3) then begin
    // Comprobar quees un memo
    if Column.Field is TMemoField then begin
      // Acceso al memo (texto)
      Str := TBlobField(Column.Field).AsString;
      // Elimiar Saltos de carro y final de línea
      while Pos(#13, Str) > 0 do
        Str[Pos(#13, Str)] := ' ';
      while Pos(#10, Str) > 0 do
        Str[Pos(#10, Str)] := ' ';
      // Limpiar y dibujar el texto
      DbGrid1.Canvas.FillRect(Rect);
      DbGrid1.Canvas.TextOut(Rect.Left, Rect.Top, Str);
    end;
  end;
end;
__________________
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