0

Hello again,

I am doing my second project now and I am using database components. So when I run the application and the DBGrid is shown and the data is read in from the MS Acess database, all the fields are too big and you have to scroll horizontally. Is there any way in auto-resizing them accordingly to the text they contain, or can i set their default values to, say, 40 pixels?

It is not required to pass my course, it is just me being trying to make it look good.

It would be very appreciated if someone can not only post a piece of code but also show me where to declare all the variables etc!

Thanks in advance.

PS I heard there is ColWidths property, but it only applies to StringGrid if I am correct...

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by Micheus
0

So when I run the application and the DBGrid is shown and the data is read in from the MS Acess database, all the fields are too big and you have to scroll horizontally.

Doesn't You used to add columns to the TDBGrid? Becose this way You can resize columns at design-time.
You can set field's property DisplayWidth too, but this is in character size - not pixels.

Is there any way in auto-resizing them accordingly to the text they contain, or can i set their default values to, say, 40 pixels?

I think isn't a good idea. You must read all rows in dataset result looking for the most long size string to proceed auto-size.


p.s. sorry my poor english.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.