Solved

Selecting an item in a DropDownList

Posted on 2007-04-09
2
302 Views
Last Modified: 2010-04-15
OK, this should be simple enough but I can't seem to solve it. I need to programmatically set the selected item of a dropdownlist control if I know the value. I understand I can use DropDownList1.Items.FindByValue("1") to return the ListItem itself. What I need to do is make sure that is the selected item. Can anyone help?
0
Comment
Question by:Russ Suter
2 Comments
 
LVL 4

Accepted Solution

by:
CBeach1980 earned 125 total points
ID: 18878903
DropDownList1.Items.FindByValue("1").Selected = true
0
 
LVL 6

Expert Comment

by:Rajesh_mj
ID: 18881404
Hi'

You have to write in the select indexchanged event like below
drpList.Items.FindByValue("1").Selected = true
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question