WinForm DataBinding在业务对象C#.NET中隐藏属性

Ian*_*ink 5 .net c# data-binding attributes winforms

我的datagrid(DevExpress)会自动根据业务对象的公共字段填充网格.

我可以在字段上放置什么属性来告诉WinForm数据工具忽略它?

[???HideFromDataBindingSources???]
 public bool IsSecurity
 {
     get { return _isSecurity; }
     set { _isSecurity = value; }
 }
Run Code Online (Sandbox Code Playgroud)

Ser*_*oda 8

你应该用Browsable装饰你的财产(假)

或者甚至在您的类中实现ICustomTypeDescriptor并以更灵活的方式过滤或动态添加属性.