开发者

WinForm DataBinding Hide Property in business object C# .NET

开发者 https://www.devze.com 2022-12-18 17:35 出处:网络
My datagrid (DevExpress) automatically will populate a grid based on the public fields of a business object.

My datagrid (DevExpress) automatically will populate a grid based on the public fields of a business object.

What attribute can I place on the field to tell WinForm datab开发者_运维技巧inders to ignore it?

[???HideFromDataBindingSources???]
 public bool IsSecurity
 {
     get { return _isSecurity; }
     set { _isSecurity = value; }
 }


You should decorate your property with Browsable(false)

Or even implement ICustomTypeDescriptor in your class and filter or dynamically add properties in more agile way.

0

精彩评论

暂无评论...
验证码 换一张
取 消