Can I WrapText in DBGrid like excel ?
--
I would appreciate any help.
Andy Susanto
The issue is that in DBGrid the height of every row is the same. DBGrid
calculates DefaultRowHeight depending on the grid font. To cheat the grid,
set huge font size for the grid to extend row heigt and paint text
yourself in OnDrawColumnCell with normal font using DrawText.
--
Andrei Fomine.
DbAltGrid - multi-line layout, RTF and graphics of any kind in DBGrid.
Transfer@once - full-blown clipboard and drag-and-drop transfer in native
MS Office formats to/from any control.
www.quasidata.com
"Andy Susanto" <an...@cpssoft.com> wrote in message
news:3cfaf9f2_1@dnews...
can you give me an example ?
--
I would appreciate any help.
Andy Susanto
Quasidata wrote in message <3cfb0256$1_1@dnews>...
Download the samples for the Marco Cantů book at
http://www.marcocantu.com/ddh/default.htm
Look for Chapter 17 / GRIDDEMO
--
Andrei Fomine.
DbAltGrid - multi-line layout, RTF and graphics of any kind in DBGrid.
Transfer@once - full-blown clipboard and drag-and-drop transfer in native
MS Office formats to/from any control.
www.quasidata.com
"Andy Susanto" <an...@cpssoft.com> wrote in message
news:3cfb0f6f_2@dnews...
Can you tell me where the mistake in my code:
tblBugSTATUS = The rain in Spain falls mainly on the plain.
DBGrid.Font.Size = 20;
if Column.Field = tblBugSTATUS then begin
DBGrid1.Canvas.Font.Size := 8;
DBGrid1.Canvas.TextOut(Rect.Left,Rect.Top,
WrapText(tblBugSTATUS.AsString, #13#10, ['.',' ',#9,'-'], 42) );
end;
and the result that I get in that column about two text something like this:
The rain in Spain falls mainly on the plain. <<<< font size = 8
The rain in Spain falls mainly on the plain. <<<< font size =20
i want that text like this:
The rain in Spain falls mainly on the
plain.
--
I would appreciate any help.
Andy Susanto
Quasidata wrote in message <3cfb3ad7_1@dnews>...
Add DBGrid1.Canvas.FillRect(Rect); to clear the cell.
--
Andrei Fomine.
DbAltGrid - multi-line layout, RTF and graphics of any kind in DBGrid.
Transfer@once - full-blown clipboard and drag-and-drop transfer in native
MS Office formats to/from any control.
www.quasidata.com
"Andy Susanto" <an...@cpssoft.com> wrote in message
news:3cfc3689_1@dnews...
I add the syntax that you said DBGrid1.Canvas.FillRect(Rect); and the
result that i got a blank in Column status. If i put FillRect(Rect)
outside if statement my all Columng in DBGrid turn blank. What should I do
now ?
if Column.Field = tblBugHistSTATUS then begin
DBGrid1.Canvas.Font.Size := 8;
DBGrid1.Canvas.TextOut(Rect.Left,Rect.Top,
WrapText(tblBugHistSTATUS.AsString, #13#10, ['.',' ',#9,'-'], 10) );
DBGrid1.Canvas.FillRect(Rect);
end;
--
I would appreciate any help.
Andy Susanto
Quasidata wrote in message <3cfc753c$1_1@dnews>...
Move it one line heigher. Write text using Windows.DrawText instead of
Canvas.TextOut.
--
Andrei Fomine.
DbAltGrid - multi-line layout, RTF and graphics of any kind in DBGrid.
Transfer@once - full-blown clipboard and drag-and-drop transfer in native
MS Office formats to/from any control.
www.quasidata.com
"Andy Susanto" <an...@cpssoft.com> wrote in message
news:3cfde5ce_2@dnews...