Customize Row and Column Headers
Contents
[
Hide
]
Like Microsoft Excel, Aspose.Cells.GridWeb also uses standard headers or captions for rows (numbers like 1, 2, 3 and so on) and columns (alphabetic like A, B, C and so on). Aspose.Cells.GridWeb also makes it possible to customize captions. This topic discuss customizing row and column headers at runtime using Aspose.Cells.GridWeb API.
Customizing Row Header
To customize the header or caption of a row:
- Add the Aspose.Cells.GridWeb control to a Web Form.
- Access the worksheet in the GridWorksheetCollection.
- Set the caption of any specified row.
The headers of row 1 and 2 has been customized
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"); |
Customizing Column Header
To customize the header or caption of a column:
- Add the Aspose.Cells.GridWeb control to a Web Form.
- Access the worksheet in the GridWorksheetCollection.
- Set the caption of any specified column.
The headers of column 1, 2 and 3 has been customized
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"); |