在工作表中添加或插入行

向工作表添加行

要向工作表添加新行,请按照以下步骤操作:

  • 将 Aspose.Cells.GridDesktop 控件添加到您的形式
  • 访问任何想要的工作表
  • 添加工作表

在工作表中插入一行

要在工作表的指定位置插入新行,请按照以下步骤操作:

  • 将 Aspose.Cells.GridDesktop 控件添加到您的形式
  • 访问任何想要的工作表
  • 插入进入工作表(通过指定插入行的索引在特定位置)
 // Accessing first worksheet of the Grid

Aspose.Cells.GridDesktop.Worksheet sheet = gridDesktop1.Worksheets[0];

// Inserting row to the worksheet to the first position.

sheet.Cells.InsertRow(0);