WPF中TextBox中的AutoGuess文本类似于Excel autoComplete文本 [英] AutoGuess text in TextBox in WPF similar to Excel autoComplete text
问题描述
我需要为textBoxes实现自动完成功能。我之前已经问过类似的问题,但他们都使用了与起始字符匹配的可选项列表。
I need to implement the AutoComplete functionality to the textBoxes. I know similar questions have been asked before, but they're all using a list of the optional items that matches the starting character.
推荐答案
你好Alaa_FK,
Hi Alaa_FK,
>>我不喜欢不想要列表的东西,因为它粗鲁我的xaml
>>I don't want the list thing because it rude my xaml
我担心你需要开发自己的控件或使用第三方控件(我找不到)。
I am afraid you need develop your own control or use a third-party control(i can not find one).
>>因为它在Grid中有很多带有多行和多列的textBox。
>> because it has a lot of textBoxes in in Grid with multiple rows and columns.
如果你使用WPF Toolkit AutoCompleteBox, 你可以将它放入一个DataGridTemplateColumn,例如:
if you use WPF Toolkit AutoCompleteBox, you can put it into a DataGridTemplateColumn, something like:
<DataGridTemplateColumn>
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding SelectedOne}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<toolkit:AutoCompleteBox
ItemsSource="{Binding List}"
SelectedItem="{Binding SelectedOne, Mode=TwoWay}" />
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>
最好的问候,
Bob
这篇关于WPF中TextBox中的AutoGuess文本类似于Excel autoComplete文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!