DropDownList Problems with no default SelectedValue

G

Guest

I want to use the selected value of a drop down list to filter a data source.
When i have done this before i have used a DataSourceControl and i have just
made the drop down a control parameter, which works well. However this time
i need to combine a set of results from two databases into a single data
source so i need to use ADO to do it. The problem i come up against is that
until the value in the drop ,down box is changed, the SelectedValue property
does not seem to exist (or is set to null). I have tried setting the
SelectedIndex to a default value, and this work in so far as that index is
selected in the drop down list on the screen, however the SelectedValue
property is still null.

How do i get the vlue that is selected by default in a drop down list,
before anyone selects a different value. This just works with DataSource
controls and control parameters but you can't seem to add a controlparameter
to a ADO DataCommands Parameters collection.
 
G

Guest

You description (which you posted several times) is still a bit difficult to
understand. Your description sounds as if you are claiming that a
dropdownlist.selectedValue is null unless you change the selection. This is
not the reality though. A dropdownlist’s selectedvalue is either the first
item in the list or whatever has been marked as selected=true by default.
Then you are saying that you have a problem setting a controlparameter to
that value but you did not elaborate why.

Can you post a sample code that reproduces the problem that you described?
 

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

Members online

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top