Drop down list problem

P

Problematic Coder

I am populating a ddl from an Oracle table, this is working fine with one
exception, when I scroll through the list of values in the ddl, right at the
top there is a blank selection. There is no blank in the column of the table
it is populated from, so i must assume that this is default behavoir of the
ddl control? If so how can I prevent this?

Thanks
 
L

Lloyd Sheen

Problematic Coder said:
I am populating a ddl from an Oracle table, this is working fine with one
exception, when I scroll through the list of values in the ddl, right at
the top there is a blank selection. There is no blank in the column of the
table it is populated from, so i must assume that this is default behavoir
of the ddl control? If so how can I prevent this?

Thanks

Sorry not the default behaviour. Why would a control just add a blank
item??

You most likely have a null value in the list which gives you the blank
item. Check your data.

LS
 
P

Problematic coder

Sorry not the default behaviour. Why would a control just add a blank
item??

You most likely have a null value in the list which gives you the blank
item. Check your data.

LS

Thanks, you are correct, it is not default behavoir, turns out the
problem was rehashing old code carelessly, in the code behind I was
deliberately placing a blank in the control, like so:
Dim liBlank As ListItem = Nothing
liBlank = New ListItem("", "")
DDLAddYear.Items.Insert(0, liBlank)
I did need it previously but not in this app.
Deleted this and all is good
Thanks again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top