I have a property grid displaying a list, for example of a class Person
[TypeConverter(typeof(ExpandableObjectConverter))]
public class Person
{
public bool ShowHidden { get; set; }
public string Name { get; set; }
//[Browsable(false)]
public string Hidden { get; set; }
public override string ToString()
{
return string.Format("Person({0})", Name);
}
}
The question is how do I control the Browsable()
attribute at runtime such that when ShowHidden = false
the Hidden
line (highlighted yellow below) is omitted.
Thanks.