我正在使用 rad 自动完成文本框。我想在选择一个输入后只接受输入我必须禁用以免不接受任何输入,但我还需要删除该输入,以便用户可以删除以前的输入并输入其他输入.ie 我只需要完成 1 个选择。如果已经选择了该字段,则必须将该字段设为只读,如果我删除以前的选择,它应该可以再次编辑。
According to Telerik this is not possible, and that's correct, you can't stop the user "selecting" multiple entries, you can however prevent multiple entries from being "stored"
so when the user exists the auto complete field I remove all entries in the autocomplete box - except the first entered (and train the users) like so.
private void stripmultientries()
{
// remove multi entries in the stock cat box ??? - leaver only the first
string fulltext = radAutoCompleteBox1.Text;
// remove everything after the first semi colon //
int index = fulltext.IndexOf(";");
if (index > 0)
{
fulltext = fulltext.Substring(0, index);
}
radAutoCompleteBox1.Text = fulltext;
}
This method can be called when saving the form or when exiting the autocomplete control
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.