Watch, Follow, &
Connect with Us

Please visit our new home

Public Report
Report From: Delphi-BCB/VCL/Additional Controls/TStringGrid    [ Add a report in this area ]  
Report #:  6788   Status: Reported
Can't resize first column if wider than grid
Project:  Delphi Build #:  4.453
Version:    7.0 Submitted By:   Ari Schoenfeld
Report Type:  Basic functionality failure Date Reported:  1/7/2004 11:08:42 AM
Severity:    Commonly encountered problem Last Updated: 2/1/2004 6:37:59 AM
Platform:    All versions Internal Tracking #:  
Resolution: None  Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: (4 Total Ratings)
5.00 out of 5
Total Votes: 18
When the first column of a grid is wider than the grid itself, it can't be rezised. Any other column, even if it is wider than the grid, it can be resized.... strange bug.

Checking the VCL Source, the proiblem since to be in the grids.pas unit, in the ResizeLine procedure (or in the GetExtent procedure called there) that return a wrong width of the first column
Steps to Reproduce:
1) Drop a TStringGrid on to your form.
2) Set the fixedCols to 0
3) Resize the first and seccond columns to be wider than the grid
4) Run the app.
5) Try to rezise the first column
6) Try to rezise the seccond column

ryan mills at 6/11/2007 8:30:39 PM -
I have a code solution for this problem.  I can't seem to add it to the workaround section.  So I'll post the code changes here.  This solution works for D7 and D2006.

Can we please get this fix into the VCL ASAP?



Code Modifications:

  procedure CalcAxisState in TCustomGrid.CalcSizingState

Change the line (D7: 2232    D2006:2239) :
        Index := LastFullVisibleCell + 1;

To this:
        Index := LastFullVisibleCell;
        if (GetExtent(LastFullVisibleCell)+FixedBoundary) <= GridBoundary then

Gabriel Corneanu at 10/17/2007 6:12:59 AM -
I have an older report about this: 12258,
a slightly different solution and a workaround.

Gabriel Corneanu at 10/17/2007 6:14:21 AM -
Sorry, my report is not really older. But I just found yours...

Server Response from: ETNACODE01