Subject RE: [IBO] Lookup sizing issue
Author Helen Borrie
At 08:42 AM 7/05/2007, you wrote:
>Hi Helen,
>Thank you for your reply. However, it is now obvious to me that I did not
>provide sufficient information on my original post.
>I have a Table (T1 detail table) containing a FK, this FK points to records
>on table (T2 master table).
>T1 definition
>T2 definition
>I have a Grid which displays the record(s) of T1, but rather than displaying
>the FK (MACRO_MT_TYPE ), on the grid, I would like to display the content of
>the description field (MT_DESCRIPTION ) from T2 for the FK. So far this is
>fine, i.e. it all works.
>Since the user may like to change the relationship between T1 and T2, I
>decided to use a LookupCombo, LookupList. The LookupCombo will display the
>current description (MT_DESCRIPTION) of the selected record, and the
>LookupList contains the description of all the records in T2. So far it
>works fine.
>Please note that this LookupCombo, LookupList is displayed with in the Grid
>as a field.
>Now, the fist time the user puts a record of the grid in edit mode (i.e.
>clicks the dropdown of the lookupCombo), the sizing of the dropdown
>LookupList is incorrect. However, form this point on, the incorrect sizing
>never happens again.
>I hope that I have explained what I am trying to achieve correctly and
>clearly. I have written two simple demos if which I am happy to upload if

Aaah, OK....With the default lookup list, if you want the control to
know the width before it sees the data, you need to set the
DropDownWidth. This can be slightly tricky, since it is in pixels,
not characters, and could potentially give odd results if you design
in one resolution and deploy in another.

If you are doing that and you're still getting this pre-usage
behaviour then look more closely at the properties of your custom
popup. It is a TIB_Grid, so the width of the cell will be determined
by the FieldsDisplayWidth property of the column you are displaying
(which you set in the lookup dataset, of course). This is also in
pixels, not character count.

I'd suggest setting the desired width in BOTH places; although the
DisplayWidth should override the parent setting....

Also try setting the ListBoxStyle of the lookup list to False, as
this may be making width assumptions prior to the first accesses,
based on some default.

And you still haven't confirmed what kind of linkage you are using
here. It should not be master-detail.

As for uploading demos, sure, do so. However, I couldn't look at
anything before the end of the week as I'm AFK for a few days.

Could you please do us all a favour and trim your posts? Thanks.