Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: TStringGrid - Formatting Columns?


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 2 - Last Post: Jun 19, 2015 12:01 PM Last Post By: Barry Wood
Barry Wood

Posts: 21
Registered: 7/16/01
TStringGrid - Formatting Columns?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 19, 2015 8:49 AM
Hi

I have several TStringGrids showing data from SQL tables, bound via LiveBindings (I use XE5). However, I can't see a way to do any column formatting; like change the column name from the fieldname, or change fonts - all the stuff I can do in a dbgrid.

Is this a LiveBindings function that I need to get to grips with, or some external coding I can do for this?
Peter Below

Posts: 1,227
Registered: 12/16/99
Re: TStringGrid - Formatting Columns?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 19, 2015 10:34 AM   in response to: Barry Wood in response to: Barry Wood
Barry Wood wrote:

Hi

I have several TStringGrids showing data from SQL tables, bound via
LiveBindings (I use XE5). However, I can't see a way to do any column
formatting; like change the column name from the fieldname, or change
fonts - all the stuff I can do in a dbgrid.

Is this a LiveBindings function that I need to get to grips with, or
some external coding I can do for this?

The live bindings just handle the transfer of data between control and
data source. If you want to use custom formatting you will have to use
an OnDrawCell handler for the grid to draw the cell content yourself.

--
Peter Below (TeamB)
Barry Wood

Posts: 21
Registered: 7/16/01
Re: TStringGrid - Formatting Columns?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 19, 2015 12:01 PM   in response to: Barry Wood in response to: Barry Wood
Hi
Thanks for that, I'll look into doing that.

(Or maybe just use a dbgrid :-) ) ...
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02