Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cant acces selected value in dropdownlist

Status
Not open for further replies.

logi2000

Programmer
Jun 17, 2003
221
CR
i have a drop down list named ddl1

i am tryin to access his selected value property like this

ddl1.SelectedValue

but when i compile it sends me an error saying that

dropdownlist does not contain a definition for SelectedValue.

i am using Visual Studio .net 2002. can that be the problem.
cause i have seen in VS 2003 that you can acces the selected value of a dropdown list in that way.

so, how can i access a dropdownlist selected value in Visual Studio 2002 ?

thanks
 
ok. but the proble is that when i do:

ddl.SelectedItem.Value = 4

instead of making the item in the ddl with a value of 4,
it changes the values of the other fields to 4.

i still think that property works different in VS 2002 and VS 2003, it seems to have a different behavior.
 
i dont want to change the value of the selected item, i want to select an item from the dropdown list, based on the items value.

this line:
ddl.SelectedItem.Value = 4
changes the value of the selected item.

how can i select an item from the list based on his value ?
 
sorry..was confused as to what you were asking... use findbyvalue
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top