Skip to main content

PropertyGridControl.AutoGenerateRows Property

Gets or sets whether rows are automatically created in the control for all fields in the bound object.

Namespace: DevExpress.XtraVerticalGrid

Assembly: DevExpress.XtraVerticalGrid.v24.1.dll

NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.VerticalGrid

Declaration

public bool AutoGenerateRows { get; set; }

Property Value

Type Description
Boolean

true, if the control automatically re-creates rows when you re-bind an object; false, if the control automatically creates rows only when you bind an object for the first time.

Remarks

The SelectedObject and SelectedObjects properties allow you to specify the object(s) whose properties are displayed in the control.

propertyGridControl1.SelectedObject = myObject1;

The control displays properties annotated with the Browsable attribute set to Yes.

[Browsable(true)]
public int MyProperty { get; set; }

Use the BrowsableAttributes collection to enable the control to show properties annotated with a specific attribute. The code below enables the control to show properties annotated with the Browsable attribute set to No.

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

The AutoGenerateRows property specifies whether the control automatically re-creates rows (see the Rows collection) when you re-bind an object or change the attribute collection. If this property is enabled, you can display multiple different-type objects during the application run.

If this property is set to false, the control automatically creates rows only when you bind an object for the first time. To create rows manually when you re-bind an object or change the attribute collection, call the RetrieveFields method.

Note

Since version 17.1, the default value is true. If the static (Shared in VB) WindowsFormsSettings.DefaultSettingsCompatibilityMode property is set to v16, the default value is false. See Version Compatibility: Default Property Values for more information.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AutoGenerateRows property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also