Replies: 1 comment
CorrectionI noticed that the problem occurs even when the horizontal scrollbar is visible; when you move it, all the data cells are drawn out of alignment. To resolve this, I replaced the previous correction with these lines: if (ColCount = 1) and not (gdFixed in AState) and (ARow >= TitleOffset) then
begin
var lHOfs := ARect.Left - (inherited CellRect(ACol, ARow)).Left;
if (lHOfs <= 0) and (lHOfs >= -ColWidths[ACol]) then
FCellRectHOfs := lHOfs;
ARect := CellRect(ACol, ARow);
end;Where I also changed this function to: function TJvDBGrid.CellRect(ACol, ARow: Longint): TRect;
begin
Result := inherited CellRect(ACol, ARow);
// PATCH: applies the delta calculated in DrawCell to compensate
if (ColCount = 1) and (FCellRectHOfs <> 0) and (ARow >= TitleOffset) and not IsRectEmpty(Result) then
begin
Inc(Result.Left, FCellRectHOfs);
Result.Right := Min(Result.Left + ColWidths[ACol], ClientWidth);
end;
end;Notes
Thank you for your time |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone,
I am currently using JVCL version 3.50 with Delphi 12, and I have encountered the following issues with JvDBGrid:
1) JvDBGrid painting issue
When a TJvDBGrid is configured to display only a single column and the indicator is hidden (dgIndicator = False in Options), clicking on a cell causes it to be drawn twice if the column width exceeds the default value.
I have attached a sample project where you can reproduce the bug by clicking on the first grid.
TestJvDBGrid.zip
As a temporary workaround, I added the following fix at the very beginning of TJvDBGrid.DrawCell (around line 3563 in JvDBGrid.pas):
I haven't fully identified the root cause of why this happens; this is just a quick patch.
2) Missing separator line under titles
When using the standard Windows theme, the separator line between the column headers (titles) and the first row of data is no longer drawn.
3) Feature Request
Would it be possible to make the selected row in JvDBGrid look visually identical to the standard Delphi TDBGrid?
Thank you for your help and for your great work!
All reactions