Subject | Re: [IBO] TDBGrid property and methods in TIB_Grid. |
---|---|
Author | Frank Ingermann |
Post date | 2002-08-26T18:09:32Z |
Hi Mirko,
Mirko's wrote:
- assuming, of course, that QUANTITA is a valid column name. if you have a join
in your query, it may be necessary to use
TIB_Query1.FieldsAlignment.Add('<MYTABLENAME>.QUANTITA=R')
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.
custom painting:
procedure TmyForm.myGridGetCellProps(Sender: TObject; ACol,
ARow: Integer; AState: TGridDrawState; var AColor: TColor; AFont: TFont);
begin
if aCol=0 then aColor := clYellow;
end;
Note that when IndicateRow=True in the grid, then aCol=0 is the indicator
column, otherwise it's the first data column.
hth,
fingerman
--
-------------------------------------------------------------------------
when parsers parse, and compilers compile, then why don't objects object?
fingerbirdy - fingerman's door to Firebird
http://www.fingerbird.de
Mirko's wrote:
>>in IBO this is done at the Query level (data), not the Grid (display).strange,
>
> 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;should work - when your query is open, it should directly show in your grid.
> TIB_Query1.FieldsAlignment.Add('QUANTITA=R');
- assuming, of course, that QUANTITA is a valid column name. if you have a join
in your query, it may be necessary to use
TIB_Query1.FieldsAlignment.Add('<MYTABLENAME>.QUANTITA=R')
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:this again must be done in the grid itself, it has an "OnGetCellProps" event for
> Grid1.Columns[0].Color := ClYellow;
custom painting:
procedure TmyForm.myGridGetCellProps(Sender: TObject; ACol,
ARow: Integer; AState: TGridDrawState; var AColor: TColor; AFont: TFont);
begin
if aCol=0 then aColor := clYellow;
end;
Note that when IndicateRow=True in the grid, then aCol=0 is the indicator
column, otherwise it's the first data column.
hth,
fingerman
--
-------------------------------------------------------------------------
when parsers parse, and compilers compile, then why don't objects object?
fingerbirdy - fingerman's door to Firebird
http://www.fingerbird.de