Link to home
Start Free TrialLog in
Avatar of nk51
nk51

asked on

DBLookupComboBox and DBGrid (Delphi 3)

Hello !

How to use a DBLookupComboBox in a DBGrid ?
I want to select the data of a table in a combobox-cell.
Can you give me an example ?

Thanx.
Avatar of ZifNab
ZifNab

Hi nk51,

read this article : http://www.gnomehome.demon.nl/uddf/pages/dbgrid.htm#dbgrid1

regards, Zif.
Avatar of nk51

ASKER

The answer you give is for a DBLookUpCombo and not for a DBLookUpCombobox...
I try to use a DBLookUpComboBox with the proposed code but with no succes.


create lookup field in your DataSet (tquery or ttable)
and add a cloumn in your DBGrid that is attached to this field

but do not forget working with lookups is slow operation slow
Avatar of nk51

ASKER

Can you explain the steps to do this with more details please ?

dblClick on your main dataset (tquery or tTable)
a window will popup
click btn add new field, another window will apear
adjust properties of the new field - make field lookup and adjust its properties( they are like this when adjusting properties for DBLookupCombo...)


dblClick on your DBGrid
add cloumn in the popuped window and set the field property of this column to above created field


Avatar of nk51

ASKER

I don't understand...Sorry. What about the DBLookupCombobox ?
the above procedure will help
DBGrid will use as InplaceEditor for such colomns (linked to lookup fields) component that has similar behavior to that of
DBLookup...



Delphi DBGrid has its own DBLookupComboBox included, you don't have to make your own ! but if you do !?!

And about Zif proposed answer about DBLookupComboBox in http://www.gnomehome.demon.nl/uddf/pages/dbgrid.htm#dbgrid1 just rename your DBLookUpComboBox component name to DBLookUpCombo1 !

Regard, Adeng.
nk51,

 here is another article if you haven't figured it out yet, with the other one.

Regards, Zif.
Avatar of nk51

ASKER

To velev : which above procedure ? I don't have a good english and perhaps I don't understand what you write but I don't understand your answer...

Adeng said that "Delphi DBGrid has its own DBLookupComboBox included, you don't have to make your own !".
Is it true ? Because It's better fo me.
How to use the own DBLookupComboBox of e DBGrid?
Thanx.
hehe, forgot the article :

http://www.delumpa.com/tips/comps/comps10.htm

topic from Delumpa (writer of article)

Note: Some of you old hats at Delphi might immediately exclaim, "What's the use of this article? In Delphi 3, we have the capability of specifying a cell in a DBGrid to be a drop-down edit." Well, that's the thing, isn't it? You have to fill in the values of the Items property yourself. What I'm suggesting here is adding a TDBLookupComboBox that will enable you to look up information from another data source. This isn't available in ANY version of Delphi.
By the way, this isn't my original idea, and in fact, the technique has been around since Delphi 1. But it's valid and applicable to Delphi 3.


Regards, Zif.
ASKER CERTIFIED SOLUTION
Avatar of kretzschmar
kretzschmar
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nk51

ASKER

Just what I needed.
The latest ZifNab's comment about the article : http://www.delumpa.com/tips/comps/comps10.htm 
said the same thing.
Thanx.
Hi nk51,

i wondered about this fast evaluation.

zif,

sorry, i haven't read this article, i've figured out byself.

meikl
Avatar of nk51

ASKER

Your answer is the same as ZifNab.
And ZifNab answered the Monday, January 25 1999 - 10:56AM PST
and we are Friday, January 29 1999.
So I had all the time to try Delumpa's advices.  


... :-) I didn't answer.... I gave a comment .... ;-))

kretzschmar, no problem! Keep smiling!
:-) i smile ;-)