|
September 28th
2005
Selecting
nothing in a ComboBox #2
It's been more than
a month since discovering that to set "nothing" as
the selection in a combo box the code needed doing twice (see here).
But there was more to this .NET issue than met the eye - and once testing
got underway it soon became apparent that the combo box would suffer
if the database it was bound to had a null entry. Not too easy to describe
(so I wrote a short VB program to demonstrate it (see here)
- what happens is that the combo box selects the first item in the
list instead of nothing. So when "scrolling" through records
the combo box will at times show a value when it shouldn't.
Again this turns out to be a known issue - and the answer is to add
a row to the data in the combo box with a null value, and text like "please
select a value" (or blank if the user is allowed to select nothing...).
I have to admit that actually having that entry there explicitly is quite
nice - but that's not the point - it should have worked the other way...
Fixed in VS 2005?
|