Link to home
Start Free TrialLog in
Avatar of Mr_Shaw
Mr_Shaw

asked on

dropdown list select value

I have a dropdown list which I want to force it to select a specific value, is this possible.
Avatar of ToddBeaulieu
ToddBeaulieu
Flag of United States of America image

Sure. Set the SelectedIndex, or find the item and set it's Selected property = True.
Avatar of Mr_Shaw
Mr_Shaw

ASKER

There is no selected properted for a dropdown list. Please could you give me an example.
Avatar of srikanthreddyn143
if data is already bound to dropdownlist hten ddlist.selectedindex = index  
Avatar of Mr_Shaw

ASKER

I am binding the data from a database so I am not sure of the index value of the item i want to select.
ASKER CERTIFIED SOLUTION
Avatar of ToddBeaulieu
ToddBeaulieu
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mr_Shaw

ASKER

I need the code to actually selct not just highlight the item in the list.
DropDownList1.Items.FindByText("text here").Selected=true;
DropDownList1.Items.FindByValue("value here").Selected = true;
Avatar of Mr_Shaw

ASKER

Ok thanks guys for your help.

I figured out the last part of the problem was the order in which I was calling my stored procedures.

I will dish out the point soon.

Thanks
Avatar of Mr_Shaw

ASKER

thanks