在 TextEdit 控件中搜索 Devexpress vb.net

Search in TextEdit Control Devexpress vb.net

我的窗体中有两个控件GridControl 和TextEdit 控件。我有产品名称的批量数据。我需要在单个 TextEdit 控件中编写 15 到 20 个产品名称,用 space 分隔它们。当我在 TextEdit 中输入第一个产品名称时,它可以通过 GridView1.ApplyFindFilter("SomeProductName") 在 GridControl 中正确找到第一个产品名称。但是当我输入第二个产品名称时,它在查询中包含以前的产品名称,但我需要按 space 键而不是从 TextEdit 中自动删除以前的产品名称。

您可以使用类似这样的方法来仅搜索最后一个字词:

Public Sub ApplyFindFilterToLastTerm(terms As String)
    Dim lastTerm = terms.Split(" "c).Last
    ApplyFindFilter(lastTerm)
End Sub

并且每次用户通过处理 KeyDown 事件输入 space 时调用