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
175
webdropdown customvalues false and initial selection???
posted

Hi, I need the following from the webdropdown. Seems like a common requirement from a dropdownlist but I'm having some trouble getting this right, any idea?

  1. Only allow databound items (items in the dropdown to be selected)
  2. autocomplete text
  3. Show initial text  ie.  "Please Select" (selected value will be 0)
  4. Be able to Tab through to next object in the DOM

it appears if you allowcustomevalues set to true then you can't have ie. "Please select" show initially.

Parents
  • 24671
    posted

    Assuming you are referring to the EnableCustomValues property (there is no AllowCustomValues), yes, it works fine - you only need to set the CurrentValue to "Please Select..." , for your case.

    You can either set CurrentValue property in the markup or code behind, it should have the same effect, no matter whether EnableCustomValues=Frue (default) or False. 

    There is another property called EnableCustomValueSelection (that's probably what you are looking for). The difference is that EnableCustomValues , when set to False, will not allow custom text to be entered in real time, as soon as someone presses a key , and the new text is not present in any of the item's text - nothing will appear when that key is pressed. 

    When EnableCustomValueSelection=false, custom text will be allowed, but it will just be not possible to select these custom items via mouse or keyboard. 

    TAB doesn't go through items, KEY UP and KEY DOWN change the currently selected item in the drop down items list. When you press TAB, it will move focus on the next control  / DOM element on the page. 

    Hope it helps. Please let me know if you have any other questions.

    Thanks,

    Angel 

Reply Children