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

BaseLayoutItem.Visibility Property

Gets or sets whether the layout item is visible within the LayoutControl in regular mode (when layout customization is not performed) and in customization mode.

Namespace: DevExpress.XtraLayout

Assembly: DevExpress.XtraLayout.v19.2.dll

Declaration

[XtraSerializableProperty]
[DefaultValue(LayoutVisibility.Always)]
[DXCategory("Behavior")]
public LayoutVisibility Visibility { get; set; }

Property Value

Type Default Description
LayoutVisibility **Always**

A LayoutVisibility value.

Available values:

Name Description
Always

A layout item is visible in regular mode and in customization mode.

Never

A layout item is not visible in regular mode or customization mode.

OnlyInCustomization

A layout item is only visible in customization mode, and hidden in regular mode (when customization is not performed).

OnlyInRuntime

A layout item is only visible in regular mode, and hidden in customization mode.

Remarks

Layout items that are hidden from the LayoutControl using the Visibility property are not accessible via the LayoutControl’s hidden item collection (LayoutControl.HiddenItems) and so they are not listed in the Customization Form.

To hide a layout item at design time and make it accessible via the Customization Form at runtime, drag the item to the Customization Form. To hide a layout item in code and make it accessible via the Customization Form, use the BaseLayoutItem.HideToCustomization method. The BaseLayoutItem.RestoreFromCustomization method allows you to restore the layout item.

A layout item hidden via the Visibility property retains its position within the LayoutControl. This item is collapsed to a 1 pixel-width transparent line. Two or more adjacent hidden items are collapsed to a 2 pixel-width transparent line. When a hidden item’s visibility is restored, it’s displayed at its previous position.

Layout items hidden via the BaseLayoutItem.HideToCustomization method do not retain their positions in the layout.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Visibility 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