How do I get or set the value of a webdropdown control?
Hi George,
1) On the client-side: get_currentValue() and set_currentValue() => this is the current visible value in the input box as well. This could be different from an item's text or value properties, and can actually hold a value to something that doesn't match anything in the items
2) On the server-side: use the CurrentValue property. Also there is SelectedValue, which must match an item's Value property. A DropDownItem has Text and Value, and a couple of other properties. "Text" is what is visible to the end user, in the dropDown list of items. The SelectedValue property is done in the same way it is implemented for the ASP:DropDownList control.
Hope it helps,
Angel
Hello,
The client side method get_currentValue() is not returning me the text I enter, when it does not match any of the items.
I need a method to do this.
Shashank
Hi Shashank,
The function should do exactly this - return the current value that's normally the same as the one in the input box. Which properties do you have enabled in the control - for example what are the values for EnableAutoCompleteFirstMatch, and EnableAutoFiltering? At which point do you check what the current value is?
Thanks for the feedback,