Re: Grid cell draw
From: AlanGLLoyd (alanglloyd_at_aol.com)
Date: 11/04/04
- Next message: Maarten Wiltink: "Re: Oh boy, how did we miss this..."
- Previous message: Tom de Neef: "Re: Width of text in tRichEdit, canvas"
- In reply to: Prasad Kulkarni: "Re: Grid cell draw"
- Next in thread: AlanGLLoyd: "Re: Grid cell draw"
- Reply: AlanGLLoyd: "Re: Grid cell draw"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 04 Nov 2004 08:29:54 GMT
In article <a8274029.0411032203.559dbaec@posting.google.com>,
prasad.kulkarni@mailcity.com (Prasad Kulkarni) writes:
>After setting
>the text in this manner. I also want to auto fit the column width. We
>can calculate the largest width in the column during the
>CustomDrawCell, but when to adjust the width for the column,
You don't know either the order nor the occasions when OnDrawCell is called.
So you would be better doing the cell width adjustment outside the OnDrawCell.
Do it when you load the stringgrid with text (measuring the widths of all
Strings in every TStringGrid.Cols and doing one change, calling
LockWindowUpdate(MyStringgrid.Handle) before setting all the columns and
LockWidowUpdate(0) after, to prevent an immediate redraw on every setting
change. Also (if you allow editing of cells) call the column width setting for
the edited column in OnSetEditText.
Alan Lloyd
alanglloyd@aol.com
- Next message: Maarten Wiltink: "Re: Oh boy, how did we miss this..."
- Previous message: Tom de Neef: "Re: Width of text in tRichEdit, canvas"
- In reply to: Prasad Kulkarni: "Re: Grid cell draw"
- Next in thread: AlanGLLoyd: "Re: Grid cell draw"
- Reply: AlanGLLoyd: "Re: Grid cell draw"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|