Solved

Combobox Style : dropdownlist

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

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

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 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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

730 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