-1

I have a PropertyGrid with a lot of nested items. How can I make a searchbox to filter and display only the items matching the search string?

keenthinker
  • 7,645
  • 2
  • 35
  • 45
Gautham
  • 19
  • 2
  • Pasty: I am currently passing focus manually to an item by using predefined strings. I would like to rather have a searchbox which can dynamically pull in "similar" items. – Gautham May 25 '14 at 21:17

1 Answers1

0

Two ways -

Your best option is to implement ICustomTypeDescriptor interface and use the GetProperties() method to filter visible rows in PropertyGrid.

If you want to hack your way around - Using reflection set Browsable Attribute to false. Sample code

Here are some sample articles/links with code to implement ICustomTypeDescriptor -

http://wraithnath.blogspot.in/2011/01/implementing-icustomtypedescriptor-for.html

PropertyGrid Browsable not found for entity framework created property, how to find it?

http://www.codeproject.com/Articles/189521/Dynamic-Properties-for-PropertyGrid

Community
  • 1
  • 1
A G
  • 21,087
  • 11
  • 87
  • 112