ワークシートへの行の追加または挿入
Contents
[
Hide
]
前のトピックの 1 つと同様に、このトピックでは、Aspose.Cells.GridDesktop の API を使用して、実行時にワークシートに行を追加および挿入する機能について説明します。追加と挿入の基本的な違いは、さらに、ワークシートの行コレクションの最後に行が追加されることです。挿入と同様に、行はワークシートの指定された位置に追加できます。
ワークシートへの行の追加
ワークシートに新しい行を追加するには、次の手順に従ってください。
- Aspose.Cells.GridDesktop コントロールを形
- 任意のアクセスワークシート
- 追加行にワークシート
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// Accessing first worksheet of the Grid | |
Worksheet sheet = gridDesktop1.Worksheets[0]; | |
// Adding row to the worksheet | |
sheet.AddRow(); |
ワークシートへの行の挿入
ワークシートの指定した位置に新しい行を挿入するには、次の手順に従ってください。
- 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);