title: How do you control what is visible in a property grid at runtime?
body: <p>I have a property grid displaying a list, for example of a class <code>Person</code></p>
  
  <pre><code>[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);
      }
  }
  </code></pre>
  
  <p>The question is how do I control the <code>Browsable()</code> attribute at runtime such that when <code>ShowHidden = false</code> the <code>Hidden</code> line (highlighted yellow below) is omitted.</p>
  
  <p><img src="https://i.stack.imgur.com/tC6q4.png" alt="Screenshot"></p>
  
  <p>Thanks.</p>