?
Solved

Creating Instances of LookupCombo box

Posted on 2002-05-22
4
Medium Priority
?
346 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 17

Accepted Solution

by:
inthe earned 150 total points
ID: 7028997
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
ID: 7028999
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
ID: 7029160
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
ID: 7032065
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month9 days, 22 hours left to enroll

762 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