Back to Devexpress

LayoutControl.HideItem(BaseLayoutItem) Method

windowsforms-devexpress-dot-xtralayout-dot-layoutcontrol-dot-hideitem-x28-devexpress-dot-xtralayout-dot-baselayoutitem-x29.md

latest3.6 KB
Original Source

LayoutControl.HideItem(BaseLayoutItem) Method

Hides the specified layout item.

Namespace : DevExpress.XtraLayout

Assembly : DevExpress.XtraLayout.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public void HideItem(
    BaseLayoutItem item
)
vb
Public Sub HideItem(
    item As BaseLayoutItem
)

Parameters

NameTypeDescription
itemBaseLayoutItem

A BaseLayoutItem descendant which represents the layout item to hide.

|

Remarks

The LayoutControl stores its hidden items within the LayoutControl.HiddenItems collection. To verify whether an item is hidden use the BaseLayoutItem.IsHidden property.

End-users can hide and show layout items by moving them to or from the Customization Form via drag and drop. To show a hidden item use the BaseLayoutItem.RestoreFromCustomization method.

Note

When layout items are hidden to the Customization Form, they do not retain their positions in the layout. To preserve the position, use Visibility instead.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the HideItem(BaseLayoutItem) method.

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.

winforms-query-builder/CS/NoPreviewQueryBuilderRunner.cs#L24

csharp
this.layoutItemPreviewButton.OptionsTableLayoutItem.ColumnIndex = 2;
    this.layoutControl1.HideItem(this.layoutItemPreviewButton);
}

winforms-query-builder/VB/NoPreviewQueryBuilderRunner.vb#L25

vb
layoutItemPreviewButton.OptionsTableLayoutItem.ColumnIndex = 2
    layoutControl1.HideItem(layoutItemPreviewButton)
End Sub

See Also

HiddenItems

HideToCustomization()

IsHidden

RestoreFromCustomization

LayoutControl Class

LayoutControl Members

DevExpress.XtraLayout Namespace