属性网格自定义搜索框

本文关键字:搜索 自定义 网格 属性 | 更新日期: 2023-09-27 18:04:56

我有一个PropertyGrid与许多嵌套的项目。如何使搜索框过滤并只显示与搜索字符串匹配的项目?

属性网格自定义搜索框

两种方式-

您最好的选择是实现ICustomTypeDescriptor接口并使用GetProperties()方法来过滤PropertyGrid中的可见行。

如果你想破解你的方法-使用反射设置Browsable属性为false。示例代码

下面是一些示例文章/链接,其中包含实现ICustomTypeDescriptor的代码-

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

PropertyGrid未找到创建属性的实体框架,如何找到它?

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