Back to Devexpress

BaseColumn.Visible Property

wpf-devexpress-dot-xpf-dot-grid-dot-basecolumn-2e8503b4.md

latest4.7 KB
Original Source

BaseColumn.Visible Property

Gets or sets whether to display the column within a View. This is a dependency property.

Namespace : DevExpress.Xpf.Grid

Assembly : DevExpress.Xpf.Grid.v25.2.Core.dll

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

csharp
public bool Visible { get; set; }
vb
Public Property Visible As Boolean

Property Value

TypeDefaultDescription
Booleantrue

true, to display the column within a View; otherwise, false.

|

Remarks

To hide a column from the View, set its Visible property to false. You can sort and group data against the hidden columns.

xaml
<dxg:GridColumn FieldName="Birthday" Visible="False">

To hide a column or a band from the Column Chooser, set its BaseColumn.ShowInColumnChooser property to false.

To specify a column’s position among visible columns, use its BaseColumn.VisibleIndex property.

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

wpf-data-grid-bind-to-custom-service-with-restrictions/CS/MainWindow.xaml#L16

xml
<dxg:GridControl.Columns>
    <dxg:GridColumn x:Name="hotColumn" FieldName="Hot" Visible="False" ShowInColumnChooser="False" AllowSorting="True" AllowedSortOrders="Descending" SortOrder="Descending" />
    <dxg:GridColumn x:Name="weekColumn" FieldName="Week" Visible="False" ShowInColumnChooser="False" AllowSorting="True" AllowedSortOrders="Descending" />

wpf-data-grid-change-background-color-for-modified-cells/CS/HighlightChangedCellBehavior.cs#L69

csharp
unboundColumn.UnboundDataType = typeof(bool);
unboundColumn.Visible = false;
unboundColumn.ShowInColumnChooser = false;

wpf-data-grid-customize-automatically-generated-columns/CS/E2019/Window1.xaml.cs#L25

csharp
case "ID":
    column.Visible = false;
    break;

wpf-data-grid-change-background-color-for-modified-cells/VB/HighlightChangedCellBehavior.vb#L93

vb
unboundColumn.UnboundDataType = GetType(Boolean)
unboundColumn.Visible = False
unboundColumn.ShowInColumnChooser = False

wpf-data-grid-customize-automatically-generated-columns/VB/E2019/Window1.xaml.vb#L26

vb
Case "ID"
        column.Visible = False
End Select

See Also

Show and Hide Columns in UI

Show and Hide Columns

BaseColumn Class

BaseColumn Members

DevExpress.Xpf.Grid Namespace