[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

dropdown list select value

Posted on 2009-05-14
10
Medium Priority
?
203 Views
Last Modified: 2013-12-17
I have a dropdown list which I want to force it to select a specific value, is this possible.
0
Comment
Question by:Mr_Shaw
[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
  • 5
  • 3
  • 2
10 Comments
 
LVL 16

Expert Comment

by:ToddBeaulieu
ID: 24385046
Sure. Set the SelectedIndex, or find the item and set it's Selected property = True.
0
 

Author Comment

by:Mr_Shaw
ID: 24385070
There is no selected properted for a dropdown list. Please could you give me an example.
0
 
LVL 11

Expert Comment

by:srikanthreddyn143
ID: 24385081
if data is already bound to dropdownlist hten ddlist.selectedindex = index  
0
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 

Author Comment

by:Mr_Shaw
ID: 24385114
I am binding the data from a database so I am not sure of the index value of the item i want to select.
0
 
LVL 16

Accepted Solution

by:
ToddBeaulieu earned 1000 total points
ID: 24385166
Selected is an ITEM property. See, this all depends on what you're really trying to accomplish, so it's hard to guess from the original question.

If you know what the text is, you probably need to find the item and either set it to be selected or set the dropdown's selectedindex property = the item's index.

Here's an example:

http://answers.yahoo.com/question/index?qid=20070514035103AA1v20M
0
 
LVL 11

Assisted Solution

by:srikanthreddyn143
srikanthreddyn143 earned 1000 total points
ID: 24385218
try it

DropDownList.SelectedValue = "somevalue"



0
 

Author Comment

by:Mr_Shaw
ID: 24385298
I need the code to actually selct not just highlight the item in the list.
0
 
LVL 11

Expert Comment

by:srikanthreddyn143
ID: 24385359
DropDownList1.Items.FindByText("text here").Selected=true;
DropDownList1.Items.FindByValue("value here").Selected = true;
0
 

Author Comment

by:Mr_Shaw
ID: 24385751
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
0
 

Author Closing Comment

by:Mr_Shaw
ID: 31581448
thanks
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

656 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