M
Mike D
I've databound the dropdownlist. How do I prevent it from selecting the
first item in the list during page load.
first item in the list during page load.
Can you manually set the SelectedIndex to -1?Mike said:I've databound the dropdownlist. How do I prevent it from selecting the
first item in the list during page load.
Then you need to somehow add a blank as the first row in the binding dataset,Mike said:If I did a Sql select, for example the alpabet, the first letter "A" is
displayed in the dropdownlist yet I haven't clicked on the dropdown to
select a letter yet. If the dropdown is null, then I could search the whole
alphabet. I want the dropdownlist to display nothing until I click the
dropdown and select a value.
Mike said:It's like Muzzy just suggested. I tried Muzzy's idea with the blank being
first and that will work. I'm used to Powerbuilder retrieving the
information but putting a null value in the dropdown until I click the
dropdown button and allowing me to select my options.
Thanks guys for all your help
Mike,
I am not sure if I follow what you are saying. If there are no entries in
the dropdownlist the SelectedIndex will be equal to -1. So are you saying
that when the dropdownlist is in this state (SelectedIndex = -1 [no items
in
the list]) and you click on the dropdownlist you want it to bind to the
data
at that moment so you can make a selection?
If this is or is not correct please reply so I may understand more clearly
and try to help you.
Thanks.