Subject Empty line in TIB_LookupCombo with KeySource relationship
Author Matt Howe
Hi All,
We have recently had a problem with a TIB_LookupCombo which is setup with 7 items but would show 6, with an empty white line on the last expected row. The data is actually there where the white line is though. After scrolling 4-5 lines it does actually start painting this line properly. I initially substituted the default popup with my own TIB_Grid through the CustomPopup property on the Lookup, which seemed to solve the problem fine for me (Windows 7 aero theme) but it was still occurring on Windows 7 classic theme. I have recreated this outside of our actual application with the following steps:

Setup two tables in fresh Firebird DB.
Table 1: Document.
Table 2: Topic
Document has a FK link to Topic.

Created new Delphi app.
Added 2 forms.
Form1 creates Form2, and can repeatedly call a method on it to ShowModal and load a particular document from the database.
On Form2, I have the public method Show with integer parameter for the Document PK.
This method is as follows:
------code-------
if qryDoc.Active then
qryDoc.Close;
qryDoc.ParamByName('DOC_NO').AsInteger := aDocNo;
qryDoc.Open;
qryTopic.Open;
ShowModal;
------code-------
Pretty simple.

qryDoc is:
select
D.DOC_NO
, D.DOC_NAME
, D.DOC_TOPIC_NO
from DOCUMENT D
where D.DOC_NO = :DOC_NO
with KeyRelation of 'D' and KeyLink of 'doc_no' and KeyLinksAutoDefine is false.

qryTopic is:
select
TOPIC_NO,
TOPIC_NAME
FROM TOPIC
With no KeyRelation and KeyLink of 'topic.topic_no=document.doc_topic_no' and KeyLinksAuotDefine is false.

I have 12 documents setup, and 12 topics, just linking in a 1 to 1 relationship for now.
When I load document 1, everything works fine.
When I load document 7, which scrolls the LookupCombo list about half way, I get the blank line straight away.

I have noticed, when in our application, that if my TIB_Grid I was using as a CustomPopup had BorderRows set to 1, I wouldn't have the problem anymore (and I have an ugly workaround which utilizes this quirk).

I'm using Delphi 2007, Windows 7, IBO 4.8.7.

If you would like my database creation scripts and small Delphi app I can provide that for more detail.
If anyone has any clues, or if this is a known and fixed defect, that would be awesome.

Thanks,

Matt Howe


[Non-text portions of this message have been removed]