Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
530
Webdropdown
posted

I load a webdropdown in the manner of code below...

cmbDropDown.Items.Insert(i, New DropDownItem("", "")) 'Add empty item
Do While dr.Read
i += 1
cmbDropDown.Items.Insert(i, New DropDownItem(dr.GetValue(dr.GetOrdinal("statedescription")).ToString, dr.GetValue(dr.GetOrdinal("stateabbrev")).ToString))
Loop

I would like to set one of the values to be the default value.  I can't seem to figure out how to do this.  I am using version 15.1.  Thank you in advance.

  • 10685
    Verified Answer
    Offline posted

    Hello,

    If I understand correctly, by "default" you would like to make one of the values selected by default.
    As there is a Selected option, I expect it should be possible to make a particular item selected (populate the input), using something like the following - will do this for the forth Item:
    cmbDropDown.Items[3].Selected = true; 

    Please let me know if it is other you had in mind.