ワークシートへの列の追加または挿入
Contents
[
Hide
]
このトピックでは、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 column to the worksheet | |
sheet.AddColumn(); |
ワークシートへの列の挿入
ワークシートの指定した位置に新しい列を挿入するには、次の手順に従ってください。
- Aspose.Cells.GridDesktop コントロールを形
- 任意のアクセスワークシート
- 入れる桁の中へワークシート (挿入する列のインデックスを指定して特定の位置に)
// Accessing first worksheet of the Grid
Aspose.Cells.GridDesktop.Worksheet sheet = gridDesktop1.Worksheets[0];
// Inserting column to the worksheet to the first position.
sheet.Cells.InsertColumn(0);