Solved

Combobox Style : dropdownlist

Posted on 2004-03-24
7
276 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
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…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

895 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

16 Experts available now in Live!

Get 1:1 Help Now