自定义行和列标题
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"); |