【问题标题】:Autofill not recognizing characters after slash斜线后自动填充无法识别字符
【发布时间】:2014-08-18 05:40:38
【问题描述】:

我正在尝试在 radtextbox 中使用自动填充,这似乎运行良好,但我遇到了一个奇怪的问题。

这是我的代码:

 var tb = ((TextBox)((RadTextBoxItem)txIndexNo1.RootElement
                      .Children[0].Children[0]).HostedControl);  
 var ls = Lnq.NOs.Select(a => (a.Index)).ToArray();
 tb.AutoCompleteCustomSource.AddRange(ls);
 tb.AutoCompleteMode = AutoCompleteMode.Append;
 tb.AutoCompleteSource = AutoCompleteSource.CustomSource;

字符串应该是:(示例)

123445/14
16277/14

但是我只在反斜杠之前自动填充?

这是因为它是转义字符吗??

非常感谢任何帮助。

【问题讨论】:

    标签: c# winforms telerik


    【解决方案1】:

    这似乎是 RadTextBox 托管的 .NET TextBox 中的一个问题。这是仅使用 .NET 控件复制的问题:

    TextBox tb = new TextBox();
    tb.Parent = this;
    var ls = new string[] { "123445/14", "16277/14" };
    tb.AutoCompleteCustomSource.AddRange(ls);
    tb.AutoCompleteMode = AutoCompleteMode.Append;
    tb.AutoCompleteSource = AutoCompleteSource.CustomSource;
    

    我建议使用 Telerik 的 RadTextBoxControl,这是他们对文本框的实现。这是一个例子:

    RadTextBoxControl rtbc = new RadTextBoxControl();
    rtbc.Parent = this;
    rtbc.AutoCompleteDataSource = new string[] { "123445//14", "16277//14" };
    rtbc.AutoCompleteMode = AutoCompleteMode.Append;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-10-26
      • 2023-02-15
      • 2019-10-16
      • 1970-01-01
      • 1970-01-01
      • 2011-06-25
      • 2021-12-07
      • 1970-01-01
      相关资源
      最近更新 更多