473,472 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Adding entry to Combo

Hi,
I am filling a combo by using a table of our database. If I want "Select
your option" at first position. How can I add this?
Thanks
Mar 13 '06 #1
3 1442
comboObj.add("Select your option");

Mar 13 '06 #2
No, it's only add new values

u need this comboBox1.Text = "Select";
comboObj.add("Select your option");


--
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

Mar 13 '06 #3
On Mon, 13 Mar 2006 14:00:40 +0530, "Chakravarti Mukesh"
<cm*****@sparshindia.com> wrote:
Hi,
I am filling a combo by using a table of our database. If I want "Select
your option" at first position. How can I add this?
Thanks

To make sure your text stays at the top of the list do this:

1. fill the combobox with the other data.
2. add "<Select your option>" at item[0]

private void TestDialog_Load(object sender, EventArgs e)
{
comboBox1.Items.Add("Item1");
comboBox1.Items.Add("Item2");
comboBox1.Items.Insert(0, "<Select from list>");
comboBox1.SelectedIndex = 0;
}

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
Mar 14 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Duncan Spence | last post by:
Hi all, I'm sure I'm doing something silly here, but can't see it! I'm creating a series of combo boxes on a Windows Form in VB.NET. The lists of all of the comboboxes are identical and are...
5
by: Derek | last post by:
Let's say I have a dynamic list/menu, which gets its values from a database table, for example a list of contact people where the value is an ID number and the label is the name. However, if the...
6
by: 6thirty | last post by:
Hi, I've created a stocktaking database using Access XP. This is indexed by two fields - part number and shelf location. I am currently inputting all the data via a form. When I have entered a...
13
by: Shannan Casteel via AccessMonster.com | last post by:
I set up two tables (one with the regular claim info and another with ClaimNumber, PartNumber, and QuantityReplaced). The ClaimNumber is an autonumber and the primary key in both tables. I made a...
3
by: Craig G | last post by:
i use the following to populate a combo in a datagrid but was wondering how i would add a blank entry to the top of the combo so that on first load it has no value selected? <asp:DropDownList...
5
by: Aaron Ackerman | last post by:
I have a bound combobox the appears on a cell within the column of my bound grid when the user clicks on a cell n(In my vb.net WinForm app). I am trying to allow the adding of an item to that bound...
1
by: emanuel.levy | last post by:
I have an Access Database that I was given to modify. I am trying to add a Combo Box with the following choices Yes No Unassigned. I went into the Table and added an entry called Trained
5
by: consonanza | last post by:
I am working on a report filter form. It has 2 combo boxes (cmboSelectSubject and cmboSelectCategory) to select criteria. Selecting an entry in combo 1 restricts the options available in combo 2....
3
by: bosmatthews | last post by:
I have a main form with a subform and a second subform nested to the first subform. The data entry property for all three forms (main, subform and sub-subform) is set to "yes" because I am intending...
24
by: AccessBeetle | last post by:
I am using this "append2table" function from Allen Browne to add an item to the combobox that is not already in the list. Here is the function, with my fields and table names Function...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.