Solved

Combobox Style : dropdownlist

Posted on 2004-03-24
7
274 Views
Last Modified: 2010-04-05
thanks all experts for your help

I am using combobox with style csdropdownlist
and i need to show the text of the combobox
I had an answer that i can use combobox1.itemindex=the number of the item i want to show.
that's fine but what if the item i want to show is already chosen and i am getting it from a dataset and afcourse it matches with the item in the combobox
so i cann't use  combobox1.itemindex=the number of the item i want to show.
i need for example : combobox1:=datamodule1.table2['fieldname']

regards
0
Comment
Question by:ibrobar
  • 2
7 Comments
 
LVL 17

Accepted Solution

by:
mokule earned 50 total points
ID: 10669637
ComboBox1.ItemIndex := ComboBox1.Items.IndexOf(datamodule1.table2['fieldname'].asstring);
0
 
LVL 22

Expert Comment

by:Ferruccio Accalai
ID: 10669661
use indexof to find the index of the desired item
combobox1.itemindex := Combobox1.indexof(datamodule1.table2['fieldname]); //as your example....

0
 
LVL 22

Expert Comment

by:Ferruccio Accalai
ID: 10669678
too late and also wrong :((
combobox1.items.indexof....
i need some relax :))
0
 
LVL 11

Expert Comment

by:shaneholmes
ID: 10670373
In your previous post, it was already stated ....


ComboBox1.ItemIndex := ComboBox1.Items.IndexOf(Some String of your's here);

which is the same thing

as

ComboBox1.ItemIndex := ComboBox1.Items.IndexOf(datamodule1.table2['fieldname'].asstring);

you just had to replace the string, which was
datamodule1.table2['fieldname'].asstring

Shane
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

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…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

706 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