TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
regor
NA
61
0
Change the SelectedItem value after selecing from a DropDownList and clicked button
Dec 1 2009 6:59 AM
Hi, I have just started to use a ListItem[] in order to avoid using the collection property in the DropDownList so I have a list of items with their respective names and the values they should have behind them as follows: private void InitializeDelivPointDropDown() { items[0] = new ListItem("Select", "-1"); items[1] = new ListItem("WareTest 1", "IPaddress"); items[2] = new ListItem("WareTest 2", "IPaddress"); items[3] = new ListItem("28A", "IPaddress"); items[4] = new ListItem( "26T","IPaddress"); items[5] = new ListItem("B9 2","IPaddress"); items[6] = new ListItem("B9 8","IPaddress"); items[7] = new ListItem("All Delivery Points", "0"); WorkcellDropDownList.Items.Clear(); WorkcellDropDownList.Items.AddRange(items); } now, when this code runs it initiates the value of the WorkcellDropDownList to be the first one. So when running my scan button after I have selected a new index in the dropdownlist it still keeps the last values. also I am running this code under the Page_Load but it seems that as soon as I click the button it runs the Page_Load event which is not what I would thought it would do, any way to change this? Thanks!
Reply
Answers (
1
)
Communication With Projects
Dropdown Problem!!!