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

Mirko wrote:
> Hi,
> with standard TDBGrid I use this code to select the column
> that I want to show in a grid:
> with DBGrid1 do
> begin
> columns.clear;
> columns[0].FieldName := 'FIELD1';
> columns[0].Title.Alignment := taLeftJustify;
> columns[0].Title.Caption := 'Heigth';
> columns[0].Width := 200;
> ...
> end;
> What I must use to do the same with TIB_Grid?

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')

alternatively you can use IBO's property editor by dblclicking the query.
(using StringLists for this may look strange at first, but is far more flexible
and - once you're used to it - easier to handle)

> and it is possible to set the focus in a specified column of the grid?

that's easy: mygrid.col := <col number>;

> Thank you
> Mirko Guidolin


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

fingerbirdy - fingerman's door to Firebird