Subject Re: [IBO] TIB_LookupCombo in a Grid
Author Helen Borrie
Mike,
I set up a test project using your data and confirm that it doesn't work the way you want it to. What *does* work is this (note I have stripped down the datasets for my test):

The SQL for sqlbook:

SELECT
BANKCODE,
DTE,
ACCOUNTAMOUNT,
CHART,
(SELECT CHARTDESC FROM CHART
WHERE ACCOUNT=BANKDETAILS.CHART) AS BD_CHART
FROM BANKDETAILS

and add KeyDescLinks to sqlchart:

CHARTDESC=BD_CHART

The LookupCombo now attaches to the read-only column BD_CHART. (This is what you would expect according to the instructions in the GSG).

It's been a while but I'm sure that it worked properly (i.e. with your setup) in the version of 3.5 or 3.6 that I was working with at the time I did the GSG test stuff. However, I'll need to check that back with Jason...it *may be* that the embedded control is only intended to work this way.

Your problem is not really too much different to that described in a recent thread, where the questioner wanted to use a lookup dataset where the only column was both the Keylinks column and the list column. I don't think that was ever satisfactorily resolved.

On thing I did notice...without the KeyDescLinks, dropping the lookupcombo into the grid caused the lookupcombo's Visible property to go to False. It reverts even if you set it True, either at designtime or at runtime.

On the other hand, with the KeyDescLinks added, the embedded control's Visible property stays True.

I'll pass this little project on to Jason when he gets back and see what he has to say...

Regards,
Helen





At 10:06 PM 03-09-01 +0000, you wrote:
> > OK, so are you saying that the main dataset is retrieving
>information from the lookup dataset, other than the text associated
>with the lookup key?
>
>No. Retrieved information is the Primary Key of the Lookup table.
>I want a dropdown list to appear when the user enters the appropriate
>column of the grid. On selection the main detail table will contain
>the selected field i.e. the primary field of the lookup table.
>
>This works before I Cut & Paste the LookupCombo control into the grid.
>I have an update bar linked to the main details datasource. The user
>can append a new record with the update bar. The grid correctly shows
>a new, blank record. If the user(with the lookupcombo placed outside
>the grid) enters the lookupcombo, selects a record from the presented
>list, the grid correctly shows the selected field from the lookup
>table. This also works if the user edits a currently selected
>existing record.i.e if the user enters the lookupcombo and selects a
>different record in the lookup table, the data in the main detail
>table changes.
>
>If I then Cut & Paste the LookupCombo, then at run time, the control
>is not shown when I enter the appropriate column of the grid. This is
>why I was wondering if I need to take more control of the transaction
>rather than relying on the update bar to handle transaction control.
>
>
> >
> > Are you saying that you have more than one keylinks pair defined
>between the lookup dataset and the main dataset? (This MATTERS.)
> >
>No , only 1 pair.
>
>Doesnt the fact that I have the process working correctly if the
>Lookupcombo is outside the grid indicate that links and properties
>have been set correctly ?
>
>Mike
>
>
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

All for Open and Open for All
InterBase Developer Initiative ยท http://www.interbase2000.org
_______________________________________________________