Unbound Drop List

Posted on 2011-10-21
Last Modified: 2012-05-12
I have an unbound drop list with items on the list of:


If the user selects "Second" this value goes into a text box.  
The item shown on the drop list remains "Second".
How do I get the list to refresh so that the first item is shown after the user's selection.

I am useing
Question by:jordanhelen
    LVL 17

    Accepted Solution

    Hello, using your DropDownList SelectedIndexChanged event and the SelectedIndex property, example:
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        MyTextBox.Text = DropDownList1.SelectedValue;
        DropDownList1.SelectedIndex = 0;

    Open in new window

    LVL 17

    Expert Comment

    by:Carlos Villegas
    Sorry, VB.NET:
    Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        MyTextBox.Text = DropDownList1.SelectedValue
        DropDownList1.SelectedIndex = 0
    End Sub

    Open in new window

    LVL 17

    Expert Comment

    by:Carlos Villegas
    DropDownList1.SelectedIndex = 0 will select the first item of your List

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (…
    Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now