Solved

Column Width in a TDBGrid

Posted on 1998-07-10
7
331 Views
Last Modified: 2010-08-05
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
Comment
Question by:jdthedj
  • 3
  • 2
  • 2
7 Comments
 
LVL 3

Expert Comment

by:Matvey
ID: 1357558
DBGrid1.Columns[i].Width (where i is a column number from 0 to Count)

Regards, bosism@netvision.net.il
0
 
LVL 3

Author Comment

by:jdthedj
ID: 1357559
Hi Matvey - I tried that, but I get the error "Field Identifier expected".  It won't recognise the Columns property.
0
 
LVL 2

Expert Comment

by:kjteng
ID: 1357560
The correct answer should be

 dbGrid1.fields[ n].displayWidth:= w

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


0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 3

Author Comment

by:jdthedj
ID: 1357561
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
 
LVL 2

Accepted Solution

by:
kjteng earned 100 total points
ID: 1357562
dbGrid1.fields[ n].displayWidth:= w

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

Expert Comment

by:Matvey
ID: 1357563
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
 
LVL 3

Author Comment

by:jdthedj
ID: 1357564
Thanks guys!!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now