0
votes

I have a problem on the built in search capability of DevExpress gridview. I want to find the item 0000-000 but without typing the dash(-) in between. Is this function supported by default or do i need to override their implementation to come up with my solution?

Thank you. Happy Holidays.

1
I am not totally sure to add Regex to grid view search.There is a discuss here and maybe you check. With Regex you are able to do it devexpress.com/Support/Center/Question/Details/T274353 - onur

1 Answers

0
votes

I don't think you task can be accomplished by setting an option, it is too specific. If your goal is to get the record after you have typed "0000000", maybe you should custom the KeyDown event, stop the search manually, change the incremental search text and the continue the search, again manually.

e.g.

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);
    }
}

Also check out this topic https://documentation.devexpress.com/#WindowsForms/CustomDocument114648