Subject RE: [IBO] Re: TIB_Grid column alignment
Author Jason Wharton
I'm sorry I didn't answer this before now.
Did you get this figured out?
There is a way to figure it out using the property of the grid and the column to get the index of the field in the dataset.Fields[] array.  I think it is DataCol[] property that is passed in a grid column and that returns the filed index.  Then you just check the Alignment property of the TIB_Column object.
Jason Wharton

From: []
Sent: Monday, September 09, 2019 6:13 AM
Subject: [IBO] Re: TIB_Grid column alignment


I found the "problem". I'm using onDrawCell on this grid, to color the lines according to the value of one specific field. I'm using this:

if dm.qrFinanceiro.Active then

         with (Sender as TIB_Grid) do
              if (dm.qrFinanceiro.BufferFieldByName('tipo').AsString='PAGAR') then
                 Canvas.Font.Color := clRed
                 Canvas.Font.Color := clBlack;
               DefaultDrawCell(acol,arow,rect,state,GetCellDisplayText(acol,arow), taLeftJustify);

That taLeftJustify is my "vilain". So, how can I identify what field is been drawing, then I can change that taLeftJustify accordingly?

Thanks in advance

Em seg, 12 de ago de 2019 às 17:12, Andrei Luís <> escreveu:
I'm experiencing a strange behavior here. I had set TIB_Query->Field properties->Alignment to right for some numeric fields. In design mode, the alignment is correct, but in runtime, the columns are left aligned!

I'm not changing the alignment in runtime, any clue what is happening?