【问题标题】:DevExpress GridView SearchDevExpress GridView 搜索
【发布时间】:2016-12-29 19:36:09
【问题描述】:

我对 DevExpress gridview 的内置搜索功能有疑问。我想找到项目 0000-000 但没有在两者之间输入破折号(-)。这个函数是默认支持的还是我需要重写他们的实现来提出我的解决方案?

谢谢。节日快乐。

【问题讨论】:

标签: gridview devexpress


【解决方案1】:

我不认为你的任务可以通过设置一个选项来完成,它太具体了。如果您的目标是在输入“0000000”后获取记录,也许您应该自定义 KeyDown 事件,手动停止搜索,更改增量搜索文本并继续搜索,再次手动。

例如

private void gridView_KeyUp(object sender, KeyEventArgs e)
{
    if(gridView.GetIncrementalText().StartsWith("0000"))        
    {
       gridView.StopIncrementalSearch();
       string txt = gridView.GetIncrementalText();
       txt = // use a RegexExpression or split the inserted text and add - in   desired position
       gridView.StartIncrementalSearch(txt);
    }
}

也可以看看这个话题https://documentation.devexpress.com/#WindowsForms/CustomDocument114648

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-05-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-03-13
    • 2011-07-26
    相关资源
    最近更新 更多