View Issue Details

IDProjectCategoryView StatusLast Update
0006723JEDI VCL00 JVCL Componentspublic2021-07-27 09:40
ReporterCDamettoAssigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformDelphi 10.3 RioOSWindows 10OS Version10.00.18363
Product VersionDaily / GIT 
Target VersionFixed in Version 
Summary0006723: JvDBGrid - Problems with resizing when gdRowSelect is in options
DescriptionUsing the gdRowSelect grid option, there are some problems in resizing.

All problems happens when the horizontal scrollbar is present and you move to a column at the right side.

1) If you resize a column on the right by double-clicking between two columns, the grid is repositioned to the start left.

2) The same thing happens if you resize the grid together with the form.

3) Resizing a column on the right makes the grid flicker.
Steps To ReproduceI attach a little program where you can see these issues.
Additional InformationInheriting from the grid I got around the three problems like this:

1)
procedure TArJvDBGrid.DblClick;
var ALeftCol: Integer;
begin
  if dgRowSelect in Options then
  begin
    ALeftCol := LeftCol;
    SendMessage(Handle, WM_SETREDRAW, WPARAM(False), 0);
    try
      inherited;
      LeftCol := ALeftCol;
    finally
      SendMessage(Handle, WM_SETREDRAW, WPARAM(True), 0);
      Invalidate;
    end;
  end
  else
    inherited;
end;

2)
procedure TArJvDBGrid.WMSize(var Message: TWMSize);
var ALeftCol: Integer;
begin
  if dgRowSelect in Options then
  begin
    ALeftCol := LeftCol;
    SendMessage(Handle, WM_SETREDRAW, WPARAM(False), 0);
    try
      inherited;
      LeftCol := ALeftCol;
    finally
      SendMessage(Handle, WM_SETREDRAW, WPARAM(True), 0);
      Invalidate;
    end;
  end
  else
    inherited;
end;

3)
procedure TArJvDBGrid.MouseUp(Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  if (dgRowSelect in Options) and (Button = mbLeft) and (FGridState = gsColSizing) then
  begin
    SendMessage(Handle, WM_SETREDRAW, WPARAM(False), 0);
    try
      inherited MouseUp(Button, Shift, X, Y);
    finally
      SendMessage(Handle, WM_SETREDRAW, WPARAM(True), 0);
      Invalidate;
    end;
  end
  else
    inherited MouseUp(Button, Shift, X, Y);
end;
TagsJvDbGrid

Activities

CDametto

2021-07-27 09:40

reporter  

Test.zip (1,567,144 bytes)

Issue History

Date Modified Username Field Change
2021-07-27 09:40 CDametto New Issue
2021-07-27 09:40 CDametto Tag Attached: JvDbGrid
2021-07-27 09:40 CDametto File Added: Test.zip