5

我有一个telerik radcombobox,如下所示:

<telerik:RadComboBox x:Name="cbCustomerName"
                                 Grid.Row="1"
                                 Grid.Column="1"
                                 Grid.ColumnSpan="3"
                                 Margin="0 0 0 10"
                                 DisplayMemberPath="FullName"
                                 IsEditable="True"
                                 IsFilteringEnabled="True"
                                 ItemsSource="{Binding Customers}"
                                 OpenDropDownOnFocus="True"
                                 SelectedValuePath="CustomerId"
                                 SelectionChanged="cbCustomerName_SelectionChanged"
                                 Text="{Binding CurrentCustomer.FullName,
                                                UpdateSourceTrigger=LostFocus}" />

当我在文本框中键入不在其项目列表中的内容然后转到其他控件时,它会清除其中的文本,这是我不想要的。

我检查了所有属性,但在失去焦点后找不到任何东西可以保留它。

如果有人知道这一点,请提供帮助。

4

3 回答 3

1

我知道这个问题很老,但我想我会发布一个解决方案,以防其他人有这个问题。如果将“IsTextSearchEnabled”属性设置为“False”,则它允许自定义文本,并且在 RadComboBox 失去焦点时不会清除它。

于 2013-10-14T21:22:03.077 回答
0

您是否尝试过使用该AllowCustomText属性为真?

于 2012-08-13T18:24:32.917 回答
0

尝试添加TextSearchMode="Contains". IsFilteringEnabled="True"如果您不需要过滤结果,请尝试删除。
我不是 100% 确定,但是如果您尝试过滤它并且它没有找到任何东西,它可能会清除您的文本。

于 2012-08-15T21:15:20.260 回答