I have a combobox that is filled with a list of preset values. In the codebehind, I determine the selectedIndex value through a lookup which returns a value of 0 to ~. If the value cannot be found the codebehind function returns -1.
Setting the selectedIndex to -1 merely selects the item at index 0 and this creates a problem for users who may save the data not knowing that the value was not found in the predefined list.
So, what I would like to do is set the text of the combobox to the value that was not found, or if the search string was initially empty, set the text to "Select Item", however, this doesn't seem to be working.
To make matters more complicated, I don't want to allow users to enter custom text because the idea is to get the users to select from the predefined values.
If I add another item at index 0, then the library we are using to manage the lists will not work.
How can I add a message similar to the EmptyMessage value, except this value would be as a prompt to select an item or the incorrect item itself that I can validate on postback.