0

The Extended WPF Toolkit contains a PropertyGrid control, which allows to edit object properties. One of the feature the PropertyGrid has, is searching through the property names: enter image description here

Currently, while searching, you have to match to the exact ordering of the property's name. For example, searching for "Pet", returns the correct property. On the other hand, searching for "Names", doesn't return any results.

Is there a way to extend the search functionality, so it will enable a more flexible search?

omerts
  • 8,485
  • 2
  • 32
  • 39

2 Answers2

1

Ok found the solution.

I had to inherit the PropertyGrid, override the OnFilterChanged method, and change the filter predicate:

public class ExtendedPropertyGrid : PropertyGrid
{
    protected override void OnFilterChanged(string oldValue, string newValue)
    {
        CollectionViewSource.GetDefaultView((object) this.Properties).Filter
            = (item => (item as PropertyItem).DisplayName.ToLower().Contains(newValue.ToLower()));
    }
}
omerts
  • 8,485
  • 2
  • 32
  • 39
0

V2.9 has this buit in, just upgrade extended wpf toolkit

sramalingam24
  • 1,297
  • 1
  • 14
  • 19