Hello everyone


Hello everyone,,,,
I tried to display memo teks field on dbgrid column. here is my implementation : 

procedure TfrmLookupSalesman.grdMenuDrawColumnCell(Sender: TObject; const Rect:
TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);
var
F : TField;
sTeks: string;
begin

F := Column.Field;

if f <> nil then
begin
if (f.DataType = ftWideString) or
(f.DataType = ftWideMemo) or
(f.DataType = ftMemo) then
begin
    sTeks := f.AsString;
    grdMenu.Canvas.FillRect(Rect);
    grdMenu.Canvas.TextRect(Rect,Rect.Left,Rect.Top,sTeks);
end;
end;
end;   

but the result is not i expected. it create double teks in the grid, just like in this image. so when i point another row, that row will have double text. Can someone help me to get better result ?  Thanks in advance

Comments

Post a Comment