Solved

Combobox Style : dropdownlist

Posted on 2004-03-24
7
281 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
[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
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 23

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 23

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

Industry Leaders: 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

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…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses
Course of the Month4 days, 17 hours left to enroll

635 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