?
Solved

Selecting an item in a DropDownList

Posted on 2007-04-09
2
Medium Priority
?
313 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
CBeach1980 earned 500 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

Stack Overflow Podcast - Developer Story

Welcome to the Stack Overflow podcast recorded Thursday July 20 at Stack Overflow Headquearters in NYC. Your hosts today are podcast regulars Jay Hanlon, David Fullerton, and Ilana Yitzhaki, plus the quite irregular Matt Sherman (Stack Overflow Engineering Manager extraordinaire)

Question has a verified solution.

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

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Six Sigma Control Plans
Progress

777 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