Subject Re: [IBO] Calculated field / IB_Grid
Author Lucas Franzen
Nico Callewaert schrieb:
>
> Hi Markus,
>
> I'm using TIB_Query, not IBOQuery. I tried already before to drag
> things there, doesn't seem to work ...

Me too.

Just what Markus said: Open the QueryEditor, prepare the Query and open
the dataset.
Now you'll see the calculated field added at the end.
Drag it to the position you like and APPLY the changes.

If you open the FieldsIndex-TIB_StringList in the ObjectInspector,
you'll see that there are entries for all fields now, including your
calculated field and the position of all fields within this stringlist
will be according to the position you did within the grid.

For example if you have a query like:
SELECT
CUST_NR, CUST_NAME, CUST_LASTNAME, CUST_STREET,
CUST_ZIP, CUST_TOWN
FROM CUSTOMER

and you add a Calculated field CUST_FULLNAME and you want to show this
calculated as the first column in your grid, then move it there. In the
FieldIndex you'll see:

CUST_FULLNAME
CUST_NR
CUST_NAME
...

afterwards.
Just as long as you don't change any index-order this list will be
empty.
As soon as you do, it will be filled according to what you did in the
grid.

This is valid for e.g. the FieldsDisplayWidth, too - if you change the
width of a field in the QueryEditor you'll get entries for every changed
field width.

(By the way: these are a perfect properties to save/load the settings of
a grid as the user left it.)

Luc.