AllowCustomText属性在RadComboBox中不起作用
本文关键字:不起作用 RadComboBox 属性 AllowCustomText | 更新日期: 2023-09-27 18:21:25
我在RadCombobox中实现了Filter,但我不希望用户在下拉菜单中插入自定义文本,所以我设置了以下属性AllowCustomText = "False"
,但它不起作用,用户可以插入自定义文本。
示例组合框代码:
<telerik:RadComboBox runat="server"
AllowCustomText="False" Filter="StartsWith"
OnClientTextChange="rcbName_ClientTextChange"
OnClientSelectedIndexChanged="rcbName_ClientSelectedIndexChanged">
<Items>
<telerik:RadComboBoxItem runat="server" Text="Test"/>
<telerik:RadComboBoxItem runat="server" Text="Tests"/>
<telerik:RadComboBoxItem runat="server" Text="testData"/>
<telerik:RadComboBoxItem runat="server" Text="Other"/>
</Items>
</telerik:RadComboBox>
如果你想要这种行为,你需要设置MarkFirstMatch="true"AllowCustomText="false",将用户输入更改为最后一个选定的项目。
在线演示:http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/autocompleteclientside/defaultcs.aspx
谨致问候,阵风