Subject Re: [IBO] Programmatically change displaywidth
Author Geoff Worboys
> Hi, I have to change programmatically display width of
> a query column, but I can't understand the syntax!
> It should be something like:
> dmMain2.qryCustomers.FieldsDisplayWidth[ 'CUST_NAME' ] := 420;

If the query is already prepared then you can do something like...
Query.FieldByName('CUST_NAME').DisplayWidth := 420;

Whether the query is prepared or not you can...
Query.FieldsDisplayWidth.LinkValues['CUST_NAME'] := 420;

You can find out more by looking at the online help for
TIB_StringList.


> Second, since fields attributes are set at Dataset (i.e.
> IB_Query) level, is the above the only way to have two
> grids using the same dataset but with different widths
> and displayed fields? Or there is a IB_Grid property
> that overrides the ones set into IB_Query?

The only method I can think of would be to derive your own version of
TIB_Grid and override the UpdateColumnAttributes procedure to do your
own thing.


> Where on hell are the examples in the help file? :))

Jason has been concentrating on the code, and most of the rest of us
do the same. If you wish to volunteer to help with writing some
documentation I am sure Jason would welcome it. It can easily be
added to the .INT (interface) parts of the units, ready to be compiled
into the help file. If you are interested let me know and I can
provide more details about how it is done - or you can look at what is
already there for example.

(Finding time for documentation would simply not be in keeping with
the spirit of programming ;-)

Geoff Worboys
Telesis Computing