Project JEDI - Issue Tracker
Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004972 [JEDI VCL] 00 JVCL Components feature have not tried 2009-10-07 15:11 2011-09-21 14:10
Reporter VelhoMonge View Status public  
Assigned To AHUser
Priority normal Resolution fixed  
Status resolved   Product Version 3.38
Summary 0004972: Double-click to resize a column in JvDbGrid (Like ListView)
Description Hi,

I would like to implement a JvDBgrid Double-click Resizing event, (when the cursor is "CrHSplit") - like columns in a listview (only in vsreport style), that after doubleclicked, the columns auto-resizing. How I do it?

Note: The TMSsoftware Dataware component - DBADVgrid - can do it.
Additional Information
Tags No tags attached.
Attached Files ? file icon JvDBGrid_2011-06-20.pas [^] (160,095 bytes) 2011-06-20 16:35
? file icon JvDBGrid.pas [^] (160,445 bytes) 2011-06-20 19:32
? file icon JvDBGrid_2011-06-21.pas [^] (160,775 bytes) 2011-06-21 18:12

- Relationships

-  Notes
(0016928)
obones (administrator)
2009-12-04 14:40

I'm not sure how to do it, but if you find a way, please tell us how you did
(0018789)
stevegr (reporter)
2011-06-20 16:34

Code is ready.

Note: New code is commented { My code } for quick search.
Unit: JvDBGrid_2011-06-20.pas
(0018791)
stevegr (reporter)
2011-06-20 19:32

Updated code.
Feature added: When resize DO NOT trigger title DblClick event.
(0018795)
AHUser (developer)
2011-06-21 10:21
edited on: 2011-06-21 10:21

You have introduced the ADODataSet into the component. Doesn't GotoBookmark work for it? I don't like to introduce a specific DataSet into an unspecific component.

(0018797)
stevegr (reporter)
2011-06-21 13:01

Yes, of cource it works, and I agree with you, but there is a problem though.

Let's say that the current record is near the bottom of the grid.
Then DataSet.GotoBookmark will scroll the grid downwards and position the current record at the center fetching new rows.
This is not good in case new records have Length(Field.DisplayText) larger than the one already calculated by GetColumnMaxWidth.

1) The result whould be the DisplayText of these rows to be cut off.
2) The second problem of reposition the current record is that the user needs the rows of the grid not to move.

The only solution I checked so far is specific code for TADODataSet.
If there is a solution for TDataSet that whould be more than welcome.
(0018798)
AHUser (developer)
2011-06-21 13:53

In the crDataSet mode there shouldn't be a problem with GotoBookmark. And in the other case, wouldn't it be enough to set ActiveRecord to the old position?
(0018800)
VelhoMonge (reporter)
2011-06-21 16:10

Can you make a EXE demo? Unfortunatly without delphi (at moment)....
(0018801)
stevegr (reporter)
2011-06-21 18:05

1) Update: Memo fields did not resize right, so for ftMemo fields I used the AsString property.

2) The problem is in DataSet.GotoBookmark method, it use Resync([rmExact, rmCenter]) instead of Resync([rmExact]).
ActiveRecord didn't seem to help, any suggestions?
(0018802)
stevegr (reporter)
2011-06-22 22:53

DataSet.GotoBookmark Resync issue resolved. (Mantis 5605)
(0018815)
AHUser (developer)
2011-07-10 12:03

The changes are applied in svn revision 13085.

I have renamed the "crNone, cr..." enumeration elements to "gcrNone, gcr..." to prevent a conflict with TCursor.

Instead of using your TJvDataSet.GotoBookmark, I've introduced JvDBUtils.pas::GotoBookmarkEx.

The patch includes the JvDBGrid.pas changes from Mantis 0005605.

- Issue History
Date Modified Username Field Change
2009-10-07 15:11 VelhoMonge New Issue
2009-12-04 14:40 obones Note Added: 0016928
2009-12-04 14:40 obones Status new => acknowledged
2011-06-20 16:34 stevegr Note Added: 0018789
2011-06-20 16:35 stevegr File Added: JvDBGrid_2011-06-20.pas
2011-06-20 19:32 stevegr Note Added: 0018791
2011-06-20 19:32 stevegr File Added: JvDBGrid.pas
2011-06-21 10:21 AHUser Note Added: 0018795
2011-06-21 10:21 AHUser Assigned To => AHUser
2011-06-21 10:21 AHUser Status acknowledged => feedback
2011-06-21 10:21 AHUser Note Edited: 0018795
2011-06-21 13:01 stevegr Note Added: 0018797
2011-06-21 13:53 AHUser Note Added: 0018798
2011-06-21 16:10 VelhoMonge Note Added: 0018800
2011-06-21 18:05 stevegr Note Added: 0018801
2011-06-21 18:12 stevegr File Added: JvDBGrid_2011-06-21.pas
2011-06-22 22:53 stevegr Note Added: 0018802
2011-07-10 12:03 AHUser Note Added: 0018815
2011-07-10 12:03 AHUser Status feedback => resolved
2011-07-10 12:03 AHUser Fixed in Version => Daily / SVN
2011-07-10 12:03 AHUser Resolution open => fixed
2011-09-21 14:10 obones Fixed in Version Daily / SVN => 3.45


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker