Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 359
  • Last Modified:

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
0
jdthedj
Asked:
jdthedj
  • 3
  • 2
  • 2
1 Solution
 
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
 
kjtengCommented:
The correct answer should be

 dbGrid1.fields[ n].displayWidth:= w

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


0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 
kjtengCommented:
dbGrid1.fields[ n].displayWidth:= w

     This will change the width of column n to w characters width;
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

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now