Why are you using the OnSetEditText event? This is meant for passing data to/from the cell editor...
Simply set the alignment when you fill the cell texts, in any order:
procedure TForm1.FormCreate(Sender: TObject);
begin
sWorksheetGrid1.HorAlignment[1, 1] := haCenter;
sWorksheetGrid1.Cells[1, 1] := 'centered';
sWorksheetGrid1.Cells[2, 2] := 'centered';
sWorksheetGrid1.HorAlignment[2, 2] := haCenter;
end;
Thanks, Is it possible to define a range of cells, like this :
sWorksheetGrid1.HorAlignment[A1:D10] := haCenter;