Subject Re: [IBO] TDBGrid property and methods in TIB_Grid.
Author Frank Ingermann
Hi Mirko,

Mirko's wrote:
>>in IBO this is done at the Query level (data), not the Grid (display).
> Have a
>>look at the various FieldsXXX properties for TIB_Queries, it's all in
> there:
>>- FieldsAlignment (put in 'FIELD1=left')
>>- FieldsGridLabel (put in 'FIELD1=Height')
>>- FieldsDisplayWidth (put in 'FIELD1=200')
> thank you for help me,
> I look the IBO help for Fieldxxx property but I don't understand exactly
> what I have to write to do by code what you say, I tried with:
> TIB_Query1.FieldsAlignment('FIELD1=R');
> or
> TIB_Query1.FieldsAlignment.clear;
> TIB_Query1.FieldsAlignment.Add('QUANTITA=R');
> and much more version but nothing.
> Can you show me the exact code to write?
> Mirko

> TIB_Query1.FieldsAlignment.clear;
> TIB_Query1.FieldsAlignment.Add('QUANTITA=R');
should work - when your query is open, it should directly show in your grid.

- assuming, of course, that QUANTITA is a valid column name. if you have a join
in your query, it may be necessary to use


when the column QUANTITA exists in both joined tables - replace <MYTABLENAME>
with the name of the table in which you want QUANTITA right-aligned, so IBO can
tell which one you mean.
> ps.I don't fount a property to change the color of a column like this:
> Grid1.Columns[0].Color := ClYellow;

this again must be done in the grid itself, it has an "OnGetCellProps" event for
custom painting:

procedure TmyForm.myGridGetCellProps(Sender: TObject; ACol,
ARow: Integer; AState: TGridDrawState; var AColor: TColor; AFont: TFont);
if aCol=0 then aColor := clYellow;

Note that when IndicateRow=True in the grid, then aCol=0 is the indicator
column, otherwise it's the first data column.


when parsers parse, and compilers compile, then why don't objects object?

fingerbirdy - fingerman's door to Firebird