Error setting SelectedValue

Discussion in 'ASP .Net' started by tshad, Jun 2, 2010.

  1. tshad

    tshad Guest

    We have a situation that is a little strange.

    We have a DropDownList which has 8 items the values are 0-7.

    If we do:

    cboLocation.Selected = "0";

    This works the first time but the second time we do that we get an error:

    "'cboLocation' has a SelectedValue which is invalid because it does not
    exist in the list of items.\r\nParameter name: value"

    In the debugger, you can see that all the values are still there (including
    "0").

    Now if I change the value to "3", I can do it 10 times and no error. If I
    change it back to "0", I get the error again.

    Why is that????

    Thanks,

    Tom
     
    tshad, Jun 2, 2010
    #1
    1. Advertisements

  2. tshad

    stanlj Guest

    Tried to duplicate your problem and could not. Also my DropDownList does not
    not have a Selected property tho if there was one, i would think that would
    be take a true/false value. Did u ever figure this out?
     
    stanlj, Jun 16, 2010
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.