如何将 devexpress xtragrid autofiltercontion beginwith 更改为包含?
how to change devexpress xtragrid autofiltercontion beginwith to contains?
我正在使用 devexpress 16.1 版本,启用 autofilter 模式使用 columnheader,当我输入值时,它按开始字符过滤,但我想过滤包含,例如,我想得到“manager”,我将输入“ nage”。我尝试过这个,但是在过滤时我的过滤值是空的
Dim filterstr As String = GridView1.FocusedValue
GridView1.ActiveFilterString = "Contains([" & HitColumnName & "]" & "," & "'" & filterstr & "'" & ")"
提前致谢
您可以在 OptionsColumn.AutoFilterCondition 属性 中为 GridView 中的每个 列 更改筛选条件。
我建议您阅读 XtraGrid 的文档 Filtering:
Tutorial: Column Filter Dropdowns
Tutorial: Data Filtering Basics and Filter Panel Settings
您可以在设计器中的列属性中进行设置:
和实用如下:
gridView1.Columns[0].OptionsFilter.AutoFilterCondition = DevExpress.XtraGrid.Columns.AutoFilterCondition.Contains;
参考文献:
XtraGrid - Provide a property to change filtering type from "begins with" to "contains", etc.
How to set filter condition as CONTAINS for AutoFilter row through code at grid level
How to set auto filter row text of specific columns via code
我正在使用 devexpress 16.1 版本,启用 autofilter 模式使用 columnheader,当我输入值时,它按开始字符过滤,但我想过滤包含,例如,我想得到“manager”,我将输入“ nage”。我尝试过这个,但是在过滤时我的过滤值是空的
Dim filterstr As String = GridView1.FocusedValue
GridView1.ActiveFilterString = "Contains([" & HitColumnName & "]" & "," & "'" & filterstr & "'" & ")"
提前致谢
您可以在 OptionsColumn.AutoFilterCondition 属性 中为 GridView 中的每个 列 更改筛选条件。
我建议您阅读 XtraGrid 的文档 Filtering:
Tutorial: Column Filter Dropdowns
Tutorial: Data Filtering Basics and Filter Panel Settings
您可以在设计器中的列属性中进行设置:
和实用如下:
gridView1.Columns[0].OptionsFilter.AutoFilterCondition = DevExpress.XtraGrid.Columns.AutoFilterCondition.Contains;
参考文献:
XtraGrid - Provide a property to change filtering type from "begins with" to "contains", etc.
How to set filter condition as CONTAINS for AutoFilter row through code at grid level
How to set auto filter row text of specific columns via code