Adding select message to a combobox

dmyst3

Member
Joined
Oct 24, 2007
Messages
6
Programming Experience
Beginner
Hello,
I have a ComboBox which is bind to a Dataset, here is the code behind for the combo.

Me.PRC_TableAdapter.Fill(Me.DataSet.PRC_getFirstTable)

how can i add a --Please select-- message to the combobox before it gets bind to the ds.
 
I think so too, but I'm rarely writing software to my own specification...

By the way, I've seen softwares with a database containing a "Choose an item" record way too many times! :eek:

SHoot the developers for that one. I think the "Please Select" in the data model is actually quite a valid place to put it, because it gives us a value that is unacceptable and can be thrown out by the database. DisplayMember = "Please Select", ValueMember = <some value that violates constraints>

The record would never be written if left at its default, and your "too many Choose n Item" records wouldnt exist..
 
If you look at vista, you'll see that Microsoft thinks the answer is "no" - many vista TBs contain some text in grey to indicate what the user should do with that textbox.

Perhaps the best example I've seen is <to change the saved password, click here> in dial up networking.. it neatly obscures the length of the password, shows that windows has one set already, and tells the user what will happen if they type in the box.. I'm still not sure why defy the established convention of ****** but then again, that DOES reveal the password length (unless it's deliberately set to a number of stars other than the lenght, in order to obscure the length, but then leading to the confusion "gosh, is my password really that long? i wonder what it could be..")

I think the --Please Select-- has come about from back-transition from web pages, an environment where it was more important that the user got things right first time to avoid slow progress through forms. I can see its merits in a GUI app, because users generally need as much help as possible to know the minimum of effort they have to put in to achieve their goal
Those TextBoxes you speak of are special cases, or at least all the ones I've seen are. In some cases they don't have a label beside them to indicate what they are for, e.g. the Password field on the Vista login page. In others the ghost text provides special instructions. The Dialup Networking password field is an example of the second type. The user is ONLY required to enter a password if they wish to change it from the current value, which is not displayed. If there was no ghost text then the user would likely think they had to enter a password every time. They certainly could have displayed a masked password or an arbitrary number of mask characters, but there are arguments against both of those.

A regular ComboBox is nothing like those situations. I think that anyone who can't work out that they need to select an item in a ComboBox with a Label next to it is beyond being helped by a "Please Select" prompt. The sort of instructions they would need to be genuinely useful would be too long to fit into a ComboBox.
 
Hi
The easiest solution i found (and it is working) to create an array list, have as the first member the 'Please select' statement then do a loop through the datasource and add them to the arraylist finally make the arraylist the datasource for the combo
 
Now why would you bother to do something like that? You download data into a container (dataable) that you could very easily insert a row into at a position you want, but instead you create another data container, insert something into it, and then copy all the data out of the one container, into the other container

Tell me, when you make a cup of coffee, do you pour the water out of the kettle, into a jug, and then pour it out of the jug into the coffee cup?
 
Back
Top