Column Width in a TDBGrid

Is there a way to determine the width of each column in a TDBGrid.

If a user has resized one or more columns I want to know the new widths.

I am using D1 and WFW 3.11
LVL 3
jdthedjAsked:
Who is Participating?
 
kjtengConnect With a Mentor Commented:
dbGrid1.fields[ n].displayWidth:= w

     This will change the width of column n to w characters width;
0
 
MatveyCommented:
DBGrid1.Columns[i].Width (where i is a column number from 0 to Count)

Regards, bosism@netvision.net.il
0
 
jdthedjAuthor Commented:
Hi Matvey - I tried that, but I get the error "Field Identifier expected".  It won't recognise the Columns property.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
kjtengCommented:
The correct answer should be

 dbGrid1.fields[ n].displayWidth:= w

This will change the width of column n to w characters width;


0
 
jdthedjAuthor Commented:
Hi kjteng - if you'd like to turn your comment into an answer I'll give you the points.  Thanks a lot.

Sorry Matvey!!
0
 
MatveyCommented:
Hi, I'm sorry, didn't see that it's D1. My answere was for D2 and 3, but I guess it wasn't yet implemented in D1...

Cheers.
0
 
jdthedjAuthor Commented:
Thanks guys!!
0
All Courses

From novice to tech pro — start learning today.