行ヘッダーと列ヘッダーのカスタマイズ
Contents
[
Hide
]
Microsoft Excel と同様に、Aspose.Cells.GridWeb も行 (1、2、3 などの数字) と列 (A、B、C などのアルファベット) に標準のヘッダーまたはキャプションを使用します。 Aspose.Cells.GridWeb ではキャプションのカスタマイズも可能です。このトピックでは、Aspose.Cells.GridWeb API を使用して実行時に行ヘッダーと列ヘッダーをカスタマイズする方法について説明します。
行ヘッダーのカスタマイズ
行のヘッダーまたはキャプションをカスタマイズするには:
- Aspose.Cells.GridWeb コントロールを Web フォームに追加します。
- GridWorksheetCollection でワークシートにアクセスします。
- 指定した行のキャプションを設定します。
行 1 と 2 のヘッダーはカスタマイズされています
This file contains 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 the worksheet that is currently active | |
GridWorksheet workSheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex]; | |
// Create custom row header caption. | |
workSheet.SetRowCaption(1, "Row1"); | |
workSheet.SetRowCaption(2, "Row2"); |
列ヘッダーのカスタマイズ
列のヘッダーまたはキャプションをカスタマイズするには:
- Aspose.Cells.GridWeb コントロールを Web フォームに追加します。
- GridWorksheetCollection でワークシートにアクセスします。
- 指定された列のキャプションを設定します。
列 1、2、および 3 のヘッダーはカスタマイズされています
This file contains 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 the worksheet that is currently active | |
GridWorksheet workSheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex]; | |
// Creates custom column header caption. | |
workSheet.SetColumnCaption(0, "Product"); | |
workSheet.SetColumnCaption(1, "Category"); | |
workSheet.SetColumnCaption(2, "Price"); |