Skip to main content
A newer version of this page is available. .

PropertyGridControl.BrowsableAttributes Property

Gets or sets the collection of browsable attributes.

Namespace: DevExpress.XtraVerticalGrid

Assembly: DevExpress.XtraVerticalGrid.v19.2.dll

Declaration

[Browsable(false)]
public AttributeCollection BrowsableAttributes { get; set; }

Property Value

Type Description
AttributeCollection

A AttributeCollection object that represents the collection of browsable attributes.

Remarks

The PropertyGridControl only displays the properties marked with attributes from the BrowsableAttributes collection. The BrowsableAttributes collection initially contains one attribute - System.ComponentModel.BrowsableAttribute.Yes. You can add other attributes to this collection if necessary.

By default, the control is not refreshed after you change the BrowsableAttributes property. To automatically refresh the control, set the PropertyGridControl.AutoGenerateRows property to true. To refresh the control manually, call the PropertyGridControl.RetrieveFields method.

Example

The following code shows how to display non-browsable properties in the PropertyGridControl.

propertyGridControl1.SelectedObject = this;
propertyGridControl1.BrowsableAttributes = new AttributeCollection(new Attribute[] { BrowsableAttribute.No });
propertyGridControl1.RetrieveFields();

Example

In the following example, the PropertyGrid control will display the properties marked with the DesignerSerializationVisibilityAttribute.Content attribute.

using System.ComponentModel;

Attribute[] attr = new Attribute[] { DesignerSerializationVisibilityAttribute.Content };
propertyGridControl1.BrowsableAttributes = new AttributeCollection(attr);
propertyGridControl1.RetrieveFields();
See Also