CRDBGrid Column Width disregarding settings
Posted: Tue 07 Sep 2010 03:01
Environment:
MyDAC 5.90.0.58
Borland C++ Builder 6 Enterprise
Win XP Pro SP3
Problem:
This may be a very noob problem, but I have been buggered by it for some time, and couldn't find any similar problem with the forum search.
The CRDBGrid will occasionally disregard the column width I set for the columns and expend the width no matter how I set the column size or OptionsEx->Stretch. The columns will just expend beyond the width I demanded and causing the horizontal scroll bar to appear.
I want all my columns to appear in the exact area I set for the Grid, i.e. I can see all columns in one glimpse. This behavior of disregarding the option and width limit is causing quite a lot of headache.
Anyone know how to make this bad kid (CRDBGrid) behave as being told?
more details:
My Grid accommodates a query result from a JOIN of 2 tables resulting of 23 columns, but I only display 10 of them, since some columns are meant for system use, not for the user to see, so those are not added to the column list of the Grid. Each column is set to 60 px, so it's well within the Grid width (650 px).
However upon running the application (The columns are behaving nicely while in design time), all the columns will expend to about 100 px (roughly estimation by eye), causing some of the columns have to be scrolled to be revealed, not to mention that the overly widened columns are so ugly to see. Some of the columns contains decimal (5,2) data and some contains enum('A', 'B', 'C', 'D', 'E', 'F') data. 100 px is definitely tooooooo wide for such data.
I doubt the widening has anything to do with the table being JOIN-ed (thus the 'hidden' columns), since I have encountered the same problem from a single table with all columns added.
Sometimes if I set the OptionsEx->Stretch to true may solve the problem (the columns is stretched nicely), but sometimes it won't help a bit, the columns still expend for no apparent reason.
Any help? Thanks in advance.

Image: this is how the Grid looks like at design time.

Image: this is how it looks like at run time the last 2 columns have been pushed out of the grid's default display area.
MyDAC 5.90.0.58
Borland C++ Builder 6 Enterprise
Win XP Pro SP3
Problem:
This may be a very noob problem, but I have been buggered by it for some time, and couldn't find any similar problem with the forum search.
The CRDBGrid will occasionally disregard the column width I set for the columns and expend the width no matter how I set the column size or OptionsEx->Stretch. The columns will just expend beyond the width I demanded and causing the horizontal scroll bar to appear.
I want all my columns to appear in the exact area I set for the Grid, i.e. I can see all columns in one glimpse. This behavior of disregarding the option and width limit is causing quite a lot of headache.
Anyone know how to make this bad kid (CRDBGrid) behave as being told?
more details:
My Grid accommodates a query result from a JOIN of 2 tables resulting of 23 columns, but I only display 10 of them, since some columns are meant for system use, not for the user to see, so those are not added to the column list of the Grid. Each column is set to 60 px, so it's well within the Grid width (650 px).
However upon running the application (The columns are behaving nicely while in design time), all the columns will expend to about 100 px (roughly estimation by eye), causing some of the columns have to be scrolled to be revealed, not to mention that the overly widened columns are so ugly to see. Some of the columns contains decimal (5,2) data and some contains enum('A', 'B', 'C', 'D', 'E', 'F') data. 100 px is definitely tooooooo wide for such data.
I doubt the widening has anything to do with the table being JOIN-ed (thus the 'hidden' columns), since I have encountered the same problem from a single table with all columns added.
Sometimes if I set the OptionsEx->Stretch to true may solve the problem (the columns is stretched nicely), but sometimes it won't help a bit, the columns still expend for no apparent reason.
Any help? Thanks in advance.

Image: this is how the Grid looks like at design time.

Image: this is how it looks like at run time the last 2 columns have been pushed out of the grid's default display area.

