TStringGrid and its ancestors do not provide a property for text alignment because there is no way how to store that information for the moment when it is needed. Instead, it introduces an event OnPrepareCanvas which is called from the DrawCell method immediately before anything is painted onto the canvas.
In order to achieve right-alignment of text set the Alignment in the TextStyle of the Canvas to taRightJustify:
procedure TForm1.StringGrid1PrepareCanvas(sender: TObject; aCol, aRow: Integer;
aState: TGridDrawState);
var
ts: TTextStyle;
begin
if aCol = <column to be right-aligned> then begin
ts := TStringGrid(Sender).Canvas.TextStyle;
ts.Alignment := taRightJustify;
TStringGrid(Sender).Canvas.TextStyle :=ts;
end;
end;
This event is very important for modifying how a cell is painted. You can also change the font or background color here.
[EDIT]
If you work with columns there's an easier way though: Select the column in the object inspector, and set its "Alignment" to taRightJustify. This setting is valid for the entire column; the alignment of the Title can be changed by using Title.Alignment. Above solution has the advantage that individual cells can be handled separately.