Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WinForm DataBinding Hide Property in business object C# .NET

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 databinders to ignore it?

[???HideFromDataBindingSources???]
 public bool IsSecurity
 {
     get { return _isSecurity; }
     set { _isSecurity = value; }
 }
like image 517
Ian Vink Avatar asked Jan 29 '10 17:01

Ian Vink


1 Answers

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.

like image 107
Sergey Mirvoda Avatar answered Sep 27 '22 21:09

Sergey Mirvoda