Subject Re: [IBO] ib_grid
Author Helen Borrie
At 06:26 AM 1/11/2007, you wrote:
>Hello to all
>Use Delphi 7 with IBO ... Before I used the component grid and achieve
>Do the following: -
>RxDBGrid.Columns [0]. FieldName: = 'CodigoBarra';
>RxDBGrid.Columns [1]. FieldName: = 'Description';
>RxDBGrid.Columns [0]. Title.Caption: = 'Reference';
>RxDBGrid.Columns [1]. Title.Caption: = 'Description';
>How do the same procedure using the component IB_GRID the IBO?

The native IBO controls are controlled by the datalink between the control and the dataset, so you don't set attributes in the control at all. This is quite different to any other controls you have used.

After linking up the ib_query with the ib_grid using the ib_datasource, you go into the Fields Editor of the ib_query (double-click on the glyph) and enter all of the display information there in the Fields tab. There are sets of field attributes for each field.

The attribute you want for the title caption is DisplayLabel. (Other attributes can be set also, such as DisplayWidth, Alignment and many more.)

If you have fields in the set that you don't want to display in the grid, set the Visible property to False.

If you want the grid to display the fields in a different order from the fetched order, you can use the GridLinks property.

There are equivalent properties for the ib_dataset, where you can set the attributes for all fields at run-time, e.g., FieldsDisplayLabel, a stringlist property, where you might enter a list like:

CodigoBarra=Reference
Description=Description

(Do not leave spaces around the "=" symbol!)

You can also populate the Fields.... stringlist properties directly in the IDE at design-time.

Study the Help for TIB_Grid - it is a complex control and there's a lot to know. :-)

Helen