View Issue Details

IDProjectCategoryView StatusLast Update
0006082JEDI VCL00 JVCL Componentspublic2015-09-14 13:20
Reporterfrank_jepsenAssigned ToAHUser 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
PlatformWindowsOSWindows 7OS Version
Product Version3.46 
Target VersionFixed in Version3.48 
Summary0006082: Fix for 5818 brought error in sizing columns in JvDBGrid
DescriptionAn reported error when autosizing columns in JvDBGrid (Mantis 5818) was "fixed" in 3.46.
This "fix" however causes wrong columns to be resized when the grid is scrolled to the right.
Steps To ReproduceThe attached project copies the example from 5818. I added an example for with more columns. To see the effect simply scroll the second table right and try to resize columns.
Additional InformationTo fix this I suppose to remove the fix in TJvDBGrid.CalcSizingState() and add this code at the end of this procedure:
if Index > ColCount - 1 then
  Index := ColCount - 1;
TagsNo tags attached.

Activities

2013-02-14 13:01

 

JvDbGrid-1.zip (1,661 bytes)

frank_jepsen

2013-02-14 14:25

reporter   ~0020425

Sorry I was too quick. Allthough this is not resolved in the last release build 3.47, I just saw, that this issue was covered again in the last builds. With this change it also works for me.

frank_jepsen

2013-02-14 14:51

reporter   ~0020426

With this change I can still produce an List Index Out Of Bounds Exception in the first example. In this example LeftCol is 1 and VisibleColCount is 1. So an Index of 2 could be calculated but it should be a maximum of 1. I think Index should be tested for ColCount-1.

stevegr

2013-02-15 20:05

reporter   ~0020430

Hi frank,
I tested your code but unfortunately is producing problem for the right-most column when is partially displayed.

A fix is uploaded in 6069 issue.

Regards,
Stephen
(ADG)

frank_jepsen

2013-02-18 11:46

reporter   ~0020433

Hi Stephen,

my approach was simple and pragmatic to resolve the List out of bounds exception. I can produce no problem with it, even in the case you pointed out.
What do you mean?

I only handled the symptom and you went to the source I think. I can't produce
any problems with either solution.

Regards
Frank

stevegr

2013-02-18 13:04

reporter   ~0020434

Hi frank,
thank's for replying,

I reproduce problem only on the first column of the grid when displayed partially, it resizes the next column instead. Does NOT affect single-column grids.
I'll be happy to hear from you again.

Regards.

frank_jepsen

2013-02-18 13:40

reporter   ~0020435

Hi Stephen,

you are right. I could reproduce this.

Your fix seems to handle all cases I tested.

I think it should be used for JVCL.

Regards
Frank

AHUser

2013-05-25 14:25

developer   ~0020501

Fixed in svn revision 13517.

Issue History

Date Modified Username Field Change
2013-02-14 13:01 frank_jepsen New Issue
2013-02-14 13:01 frank_jepsen File Added: JvDbGrid-1.zip
2013-02-14 14:25 frank_jepsen Note Added: 0020425
2013-02-14 14:51 frank_jepsen Note Added: 0020426
2013-02-15 20:05 stevegr Note Added: 0020430
2013-02-18 11:46 frank_jepsen Note Added: 0020433
2013-02-18 13:04 stevegr Note Added: 0020434
2013-02-18 13:40 frank_jepsen Note Added: 0020435
2013-05-25 14:25 AHUser Note Added: 0020501
2013-05-25 14:25 AHUser Status new => resolved
2013-05-25 14:25 AHUser Fixed in Version => Daily / SVN
2013-05-25 14:25 AHUser Resolution open => fixed
2013-05-25 14:25 AHUser Assigned To => AHUser
2015-09-14 13:20 obones Fixed in Version Daily / GIT => 3.48