Solved

Creating Instances of LookupCombo box

Posted on 2002-05-22
4
341 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
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Mydac connection data base issue 3 156
how to manage invalidate between two tvirtualstringtree in same form? 1 113
code issue 8 127
Help on project with Soap 10 53
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

813 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

17 Experts available now in Live!

Get 1:1 Help Now