combobox(ajaxcontroltoolkit)的text属性不清楚。 [英] Text property of combobox (of ajaxcontroltoolkit) don't be clear.
问题描述
你好
i从ajaxcontroltoolkit用于组合框。
用于搜索有时我需要清除我的组合框的文本属性,直到搜索方法返回所有记录(没有过滤器)
但命令(mycombobox.text =)不起作用。为什么?
谢谢
我的尝试:
i无法做任何事情...
help
AjaxControlToolkit ComboBox
的行为与标准的ASP.NETDropDownList
控件类似,所以从技术上讲,你无法使用.Text
属性清除文本通常使用标准TextBox
控件的操作。 />
您可以做的是在Page_Load <上向
ComboBox
中插入一个空值/ code>事件:
ComboBox1.Items.Insert( 0 ,New ListItem( ))
现在,这将在ComboBox
列表中放置一个空字符串。然后你可以打电话:
ComboBox1.ClearSelection();
将SelectedIndex
重置为默认项目,或者如果你想要这样的话,你可以删除空值:
ComboBox1.Items.Remove( 跨度>);
Hello
i use from ajaxcontroltoolkit for a combobox.
for search sometimes i nead to cleat text property of my combobox until search method return all record (without filter)
but the command (mycombobox.text = "") dont work. why?
Thanks
What I have tried:
i could't do any things...
help
TheAjaxControlToolkit ComboBox
behaves similarly as the standard ASP.NETDropDownList
control, so technically, you can't clear the text just what you normally do with the standardTextBox
control using the.Text
property.
What you can do is insert an empty value to yourComboBox
like this onPage_Load
event:
ComboBox1.Items.Insert(0, New ListItem(""))
Now, this will put an empty string in yourComboBox
list. You can then call:
ComboBox1.ClearSelection();
to reset theSelectedIndex
to the default item or you could remove the empty value if you'd like something like:
ComboBox1.Items.Remove("");
这篇关于combobox(ajaxcontroltoolkit)的text属性不清楚。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!