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
Hi Angel,
Is there anywhere I can read up more about set_currentvalue() ? What is the proper syntax for using it?
I get an error "Object doesn't support this property or method."
Thanks,
Deep.
My WebDropDown has multi-select checkbox enabled. I have default selection initalized (more than 2 items) in the code-behind page_load event. How do I reflect the input textbox with the selected values?
What values should I pass to set_currentValue() when multiple items are selected? I would appreciate your response!
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
When I set the SelectedValue using
me.cbCompStat.SelectedValue=24 it displays the 1st item on the list, even though the Value is different