LCL: Fix TDBGrid editor alignment when FixedCells>1. Issue #35715

git-svn-id: branches/fixes_2_0@62867 -
This commit is contained in:
mattias 2020-04-02 16:01:13 +00:00
parent 1159b932fb
commit bbbafe2991

View File

@ -7087,6 +7087,7 @@ end;
procedure TCustomGrid.DoEditorShow;
var
ParentChanged: Boolean;
Column: TGridColumn;
begin
{$ifdef dbgGrid}DebugLnEnter('grid.DoEditorShow [',Editor.ClassName,'] INIT');{$endif}
ScrollToCell(FCol,FRow, True);
@ -7103,8 +7104,9 @@ begin
Editor.Parent:=Self;
if (FEditor = FStringEditor) or (FEditor = FButtonStringEditor) then
begin
if FCol-FFixedCols<Columns.Count then
FStringEditor.Alignment:=Columns[FCol-FFixedCols].Alignment
Column:=ColumnFromGridColumn(FCol);
if Column<>nil then
FStringEditor.Alignment:=Column.Alignment
else
FStringEditor.Alignment:=taLeftJustify;
end;