Solved

Column Width in a TDBGrid

Posted on 1998-07-10
7
343 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Delphi procedure  - Unsatisfied forward or external declaration. 2 158
Simple Delphi Question 9 89
Delphi XE10 Round Image 2 121
Run video youtube webbrowse 10 61
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

813 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