Back to Devexpress

Column.Visible Property

officefileapi-devexpress-dot-spreadsheet-dot-column-14c2ec61.md

latest5.7 KB
Original Source

Column.Visible Property

Gets or sets whether the column is visible or hidden.

Namespace : DevExpress.Spreadsheet

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

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

Property Value

TypeDescription
Boolean

true if the column is visible; otherwise false

|

Example

This example demonstrates how to control the visibility of rows and columns in a worksheet using the Row.Visible and Column.Visible properties.

Note

You can also hide a row or column in a worksheet by setting the row height (Row.Height) or column width (Column.Width, Column.WidthInCharacters or Column.WidthInPixels) to 0, respectively (see the How to: Specify Row Height or Column Width document).

View Example

csharp
Worksheet worksheet = workbook.Worksheets[0];

// Hide the 8th row of the worksheet.
worksheet.Rows[7].Visible = false;

// Hide the 4th column of the worksheet.
worksheet.Columns[3].Visible = false;
vb
Dim worksheet As Worksheet = workbook.Worksheets(0)

' Hide the 8th row of the worksheet.
worksheet.Rows(7).Visible = False

' Hide the 4th column of the worksheet.
worksheet.Columns(3).Visible = False

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.

winforms-spreadsheetcontrol-api-part1/CS/SpreadsheetControl/SpreadsheetActions/RowAndColumnActions.cs#L140

csharp
// Hide the 4th column of the worksheet.
worksheet.Columns[3].Visible = false;
#endregion #ShowHideRowsColumns

wpf-spreadsheetcontrol-api-part-1/CS/SpreadsheetControl_WPF_API/SpreadsheetActions/RowAndColumnActions.cs#L140

csharp
// Hide the 4th column of the worksheet.
worksheet.Columns[3].Visible = false;
#endregion #ShowHideRowsColumns

spreadsheet-document-api-examples-part1/CS/SpreadsheetExamples/SpreadsheetActions/RowAndColumnActions.cs#L125

csharp
// Hide the fourth column.
worksheet.Columns[3].Visible = false;

winforms-spreadsheetcontrol-api-part1/VB/SpreadsheetControl/SpreadsheetActions/RowAndColumnActions.vb#L141

vb
' Hide the 4th column of the worksheet.
            worksheet.Columns(3).Visible = False
' #End Region ' #ShowHideRowsColumns

wpf-spreadsheetcontrol-api-part-1/VB/SpreadsheetControl_WPF_API/SpreadsheetActions/RowAndColumnActions.vb#L140

vb
' Hide the 4th column of the worksheet.
            worksheet.Columns(3).Visible = False
' #End Region ' #ShowHideRowsColumns

spreadsheet-document-api-examples-part1/VB/SpreadsheetExamples/SpreadsheetActions/RowAndColumnActions.vb#L102

vb
' Hide the fourth column.
worksheet.Columns(3).Visible = False
' Hide columns from 5 to 7.

See Also

Column Interface

Column Members

DevExpress.Spreadsheet Namespace