View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004972 | JEDI VCL | 00 JVCL Components | public | 2009-10-07 15:11 | 2011-09-21 14:10 |
Reporter | VelhoMonge | Assigned To | AHUser | ||
Priority | normal | Severity | feature | Reproducibility | have not tried |
Status | resolved | Resolution | fixed | ||
Product Version | 3.38 | ||||
Target Version | Fixed in Version | 3.45 | |||
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. | ||||
Tags | No tags attached. | ||||
|
I'm not sure how to do it, but if you find a way, please tell us how you did |
|
Code is ready. Note: New code is commented { My code } for quick search. Unit: JvDBGrid_2011-06-20.pas |
2011-06-20 16:35
|
JvDBGrid_2011-06-20.pas (160,095 bytes) |
|
Updated code. Feature added: When resize DO NOT trigger title DblClick event. |
2011-06-20 19:32
|
JvDBGrid.pas (160,445 bytes) |
|
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. |
|
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. |
|
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? |
|
Can you make a EXE demo? Unfortunatly without delphi (at moment).... |
|
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? |
2011-06-21 18:12
|
JvDBGrid_2011-06-21.pas (160,775 bytes) |
|
DataSet.GotoBookmark Resync issue resolved. (Mantis 5605) |
|
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. |
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 |