AllowCustomText属性在RadComboBox中不起作用?

时间:2014-09-10 12:02:24

标签: c# asp.net telerik radcombobox

我在 RadCombobox 中实现了过滤器,但我不希望用户在Dropdown中插入自定义文本,因此我设置了以下属性 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>

1 个答案:

答案 0 :(得分:1)

如果你想要这种行为,你需要设置MarkFirstMatch =“true”和 AllowCustomText =“false”将用户输入更改为所选的最后一个项目。

在线演示: http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/autocompleteclientside/defaultcs.aspx

亲切的问候, 拉法尔

相关问题