TWebDBGrid Alignment on wrong column

Hello,
There seems to be a strange issue with the alignment of columns on the TWebDBGrid (Webcore latest version).

I am having to set the alignment for a column on the column prior to the one I want.

So, if I have 9 columns and I require the 9th column to be right-aligned, I have to set the 8th column property as right-aligned.

The web grid with the [Renew (right-aligned)], Susp'd and Renew centred
image

To get the [Renew] column right-aligned, we need to set the [UserContact] column as right-aligned

UserContact_Renew

To get the KILLLICENSE (Susp'd), we have to set the RENEW column centred.

RenewCenter

So we have to set gridlicense.Columns[8].Alignmernt to the required alignment for gridlicense.Columns[9].alignment.

Simon

Do you have a fixed column?
The grid.Columns collection maps on the actual normal columns (mapped on DB fields)

Hello,

No Fixed columns
Columns mapped to a TWebClientDataSet.

Is it possible that a CSS layout could cause this. I say this as the Basic\WebDBGrid demo works as expected.

Simon

I cannot see a problem. I retested this here with the TWebDBGrid demo with the code:

procedure TForm1.WebButton1Click(Sender: TObject);
begin
  webdbgrid1.Columns[2].Alignment := taRightJustify;
end;

and this works as expected:

Hi Bruno,

I have reset all the alignments to taLeftJustify and removed any ElementClasses and TitleClasses, and all is working as expected.

What is the hierarchy with respect to the Grid Alignment, the Field Alignment and the Element class?

SImon

Field alignment is not used.
Use Column alignment and override when needed with element class.