Solved

Creating Instances of LookupCombo box

Posted on 2002-05-22
4
339 Views
Last Modified: 2010-04-04
I would like to use LookupCombo box with out placing component on my Form, I would like to create using coding only. Actually i have a table which connected to GRID and RVD. So when i execute my RVD from table itself i would like to specify which field will be display as Lookup Combo box. Anybody can help me please?
0
Comment
Question by:VENKAT
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 50 total points
Comment Utility
hi,
i gues you want to create it at runtime ,if so you can
create it like:

//uses DBCtrls (need to add this manually)


var
Lu : TDBLookupComboBox;
begin
Lu := TDBLookupComboBox.Create(self);
with Lu do begin
    Parent := Self;
    Name:= 'MyLu';
    Left:= 10;
    Top:= 10;
Tag := 4;
    DataSource:= DataSource1;
    DataField:= 'Category';
 //  etc for any other properties you want to set..
//also add any events you want
    OnClick := Form1.MyClick;
  end;
end;


procedure Form1.MyClick (Sender : TObject);
begin
// do something
// note here the tag property is useful if you
// have more than one as you know who was sender.
end;
0
 
LVL 7

Expert Comment

by:Motaz
Comment Utility
You can create LookupComBox as:

var
  Lookup: TLookupComboBox;
begin
  Lookup:= TLookupCompoBox(Self);
  Lookup.Parent:= Self;
  Lookup.Lef:= 100;
  Lookup.Top:= 50;
  Lookup.Datasource:= Datasource1;
  Lookup.DataField:= 'Subject';
end;

What did you mean by RVD?
Motaz
0
 
LVL 1

Author Comment

by:VENKAT
Comment Utility
hi inthe/Motaz
   i wrote code for my TwwDBLookupCombo as u write. But If i have component on my wwDBGrid, after i assign properties i used to double click the wwDBGrid by open the connected table. Then i can select that FieldName from Selected Field List and can assign ControType='CustomEdit' and ControlName='wwDBLookupCombo1'. So how to do all these thigns here. RVD means wwRecordViewDialog from InfoPower. So later when i edit my wwDBGrid with RVD, i should be able to see that Field with LookupCombo. Thats my wish. I am using all InfoPower componnets.
Thank you.
0
 
LVL 1

Author Comment

by:VENKAT
Comment Utility
Hi Inthe
   Thank u very much. I got Lookup Combo in Grid and RVD aswell. Actually 75% of my problem is solved. Next little bit is Onclick function from this combo. I did not understand ur TAG usefulness. Can u explain me clearly how to do this Onclick and also Tag useful in that. Thank u again.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now