Centering Row (0) and Column (0)

Questions and answers on how to use XLSReadWriteII 3/4/5.
Post Reply
Raymond Allan
Posts: 1
Joined: Wed Feb 20, 2008 10:21 am
Location: Scotland

Centering Row (0) and Column (0)

Post by Raymond Allan »

Hi,

Have just recently upgraded to version 3.x, from ver 2.x

I am trying to center column (0) where the row numbers will appear

the following worked fine on ver 2.x

procedure TFmEd.GridGetCellFormat(Sender: TObject; Col, Row: Integer;
State: TGridDrawState; var FormatOptions: TFormatOptions);
begin
if (Row = 0) or (Col = 0) then
FormatOptions.AlignmentHorz := taCenter;
end;

Only Row (0) is being centered

has the method changed in 3.x

Also, does anyone know a quick way to autosize all columns based on the cell in each column that has the largest text/number, like in Excel where you double click the required columns to autofit

Thanks for looking

Raymond
larsa
Site Admin
Posts: 926
Joined: Mon Jun 27, 2005 9:30 pm

Post by larsa »

Hello

1. The GridGetCellFormat is not a part of XLSReadWrietII. It seems to come from a grid component.

2. In order to autosize a column, use the AutoWidthCol method of the sheet.


Lars Arvidsson
Post Reply