Solved

Selecting an item in a DropDownList

Posted on 2007-04-09
2
300 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

776 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