[Last Call] Learn how to a build a cloud-first strategyRegister Now


selecting a combobox item at runtime.

Posted on 2007-10-14
Medium Priority
Last Modified: 2013-11-26
I am using a combBox, I want to select an item at runtime. When the form is loading the combbox is populated with values. At one time I have to populate the form with data from the database. When editing is done on the form it should replace the original form. below is a line from my code.

 Me.tlevel.Text = gcl.ReturnLevel(drd("tlevel"))

tlevel is a combobox, drd("tlevel") is a level id from a datareader "drd". actually it the (index of the selected item in the combobox) + 1, so gcl.ReturnLevel(drd("tlevel")) displays the label for that index.  But as it is loading I want it also selected because when iam saving i read the (id of the selected item) + 1 and i save that value. i use structures to populate the combobox. I am using vb.net.
Question by:Anthony Matovu
1 Comment
LVL 48

Accepted Solution

jpaulino earned 2000 total points
ID: 20073958
Didn't understant very well you point but what produces gcl.ReturnLevel(drd("tlevel")) ? And how to you fill the combobox ?

Have you tried already this
ComboBox1.SelectedIndex = ComboBox1.FindString(YourStringValue)


Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

830 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