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