[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Collapse]Spreadsheet
    Product Structure
   [Expand]Getting Started
   [Expand]Spreadsheet Document
    Supported Formats
   [Expand]Cell Basics
   [Expand]Formulas
    Defined Names
    Data Binding
    Data Validation
   [Expand]Data Presentation
   [Expand]Pivot Table Overview
   [Expand]Charting Overview
    Shapes
    Printing
    Protection
    Find and Replace
   [Expand]Mail Merge
   [Expand]Visual Elements
    Services
    Themes and Templates
   [Expand]Shortcuts
   [Collapse]Examples
    [Expand]Files
    [Expand]Workbooks
    [Expand]Worksheet
    [Collapse]Rows and Columns
      How to: Access a Row or Column
      How to: Add a New Row or Column to a Worksheet
      How to: Delete a Row or Column from a Worksheet
      How to: Copy a Row or Column
      How to: Show or Hide a Row or Column
      How to: Freeze and Unfreeze Rows and Columns
      How to: Specify Row Height or Column Width
      How to: Restrict the Number of Visible Rows and Columns in a Worksheet
    [Expand]Cells
    [Expand]Formulas
    [Expand]Data Binding
    [Expand]Formatting Cells
    [Expand]Conditional Formatting
    [Expand]Group Data
    [Expand]Filter Data
    [Expand]Tables
    [Expand]Pivot Tables
    [Expand]Printing
    [Expand]Pictures
    [Expand]Charts
    [Expand]Protection
    [Expand]Mail Merge
    [Expand]Cell Templates
    [Expand]Commands
    [Expand]Customization
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How to: Add a New Row or Column to a Worksheet

Expanded Row

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E4339.

This example demonstrates how to insert new rows into a worksheet. You can do this in the following ways.

  • Use the Row.Insert method.

  • Call the RowCollection.Insert method of the object accessed via the Worksheet.Rows property. To specify where a new row should be inserted, pass a zero-based row index to the method as a parameter. To insert multiple rows, pass the number of rows to be inserted as well.

  • To insert empty rows above the specified range of cells, use the Worksheet.InsertCells method with the cell range and InsertCellsMode.EntireRow enumeration member passed as parameters. This method inserts the same number of rows that contains the specified cell range.

Note

The number of rows in a worksheet is permanently fixed - 1048576.

Expanded Column

Show Me

A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=E4339.

This example demonstrates how to insert new columns into a worksheet. You can do this in the following ways.

  • Use the Column.Insert method.

  • Call the ColumnCollection.Insert method of the object accessed via the Worksheet.Columns property. To specify where a new column should be inserted, pass a zero-based column index to the method as a parameter. To insert multiple columns, pass the number of columns to be inserted as well.

  • To insert empty columns to the left of the specified range of cells, use the Worksheet.InsertCells method with the cell range and InsertCellsMode.EntireColumn enumeration member passed as parameters. This method inserts the same number of columns that comprising the specified cell range.

Note

The number of columns in a worksheet is permanently fixed - 16384.

Is this topic helpful?​​​​​​​