Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Show or Hide a Row or Column

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.

View Example

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;