View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006542 | JEDI VCL | 00 JVCL Components | public | 2016-12-28 16:32 | 2019-03-06 09:45 |
Reporter | CDametto | Assigned To | obones | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | unable to reproduce | ||
Product Version | 3.48 | ||||
Target Version | Fixed in Version | ||||
Summary | 0006542: Horizontal reset of dbgrid scrollbar at line click when no indicator | ||||
Description | In a DBGrid with dgRowSelect=true and dgIndicator=false in Options, whether the horizontal scrollbar is present, if you are at right end and you click on a row, the grid is repositioned to the start left. | ||||
Additional Information | This is my correction, in the file JvDBGrid.pas, in the middle of the MouseDown procedure... Original block: //------------------------------------------------------------------------------- // Prevents the grid from going back to the first column when dgRowSelect is True // Does not work if there's no indicator column //------------------------------------------------------------------------------- if (dgRowSelect in Options) and (Cell.Y >= TitleOffset) then begin // Why do we always have to work around the VCL. If we use the original X the // Grid will scroll back to the first column. But if we don't use the original X // and goRowSizing is enabled, the user can start resizing rows in the wild. WasRowResizing := goRowSizing in TCustomGridAccess(Self).Options; try // Disable goRowSizing without all the code that SetOptions executes. TGridOptions(Pointer(@TCustomGridAccess(Self).Options)^) := TCustomGridAccess(Self).Options - [goRowSizing]; inherited MouseDown(Button, Shift, 1, Y); InheritedCalled := True; finally if WasRowResizing then TGridOptions(Pointer(@TCustomGridAccess(Self).Options)^) := TCustomGridAccess(Self).Options + [goRowSizing]; end; end I declared in the procedure var SI: TScrollInfo; block with my correction: //------------------------------------------------------------------------------- // Prevents the grid from going back to the first column when dgRowSelect is True // Does not work if there's no indicator column //------------------------------------------------------------------------------- if (dgRowSelect in Options) and (Cell.Y >= TitleOffset) then begin // Why do we always have to work around the VCL. If we use the original X the // Grid will scroll back to the first column. But if we don't use the original X // and goRowSizing is enabled, the user can start resizing rows in the wild. WasRowResizing := goRowSizing in TCustomGridAccess(Self).Options; try // Disable goRowSizing without all the code that SetOptions executes. TGridOptions(Pointer(@TCustomGridAccess(Self).Options)^) := TCustomGridAccess(Self).Options - [goRowSizing]; SI.cbSize := SizeOf(SI); //ADDED SI.fMask := SIF_POS; //ADDED GetScrollInfo(Handle, SB_HORZ, SI); //ADDED LockWindowUpdate(Handle); //ADDED try //ADDED inherited MouseDown(Button, Shift, 1, Y); Perform(WM_HSCROLL, MakeWParam(SB_THUMBPOSITION, SI.nPos), 0); //ADDED finally //ADDED LockWindowUpdate(0); //ADDED end; //ADDED InheritedCalled := True; finally if WasRowResizing then TGridOptions(Pointer(@TCustomGridAccess(Self).Options)^) := TCustomGridAccess(Self).Options + [goRowSizing]; end; end | ||||
Tags | No tags attached. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2016-12-28 16:32 | CDametto | New Issue | |
2018-07-18 15:47 | obones | Note Added: 0021505 | |
2018-07-18 15:47 | obones | Status | new => feedback |
2019-01-25 12:20 | CDametto | Note Added: 0021603 | |
2019-03-06 09:45 | obones | Status | feedback => resolved |
2019-03-06 09:45 | obones | Resolution | open => unable to reproduce |
2019-03-06 09:45 | obones | Assigned To | => obones |