Customize Row and Column Headers

Customizing Row Header

To customize the header or caption of a row:

  1. Add the Aspose.Cells.GridWeb control to a Web Form.
  2. Access the worksheet in the GridWorksheetCollection.
  3. Set the caption of any specified row.

The headers of row 1 and 2 has been customized

todo:image_alt_text

// 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:

  1. Add the Aspose.Cells.GridWeb control to a Web Form.
  2. Access the worksheet in the GridWorksheetCollection.
  3. Set the caption of any specified column.

The headers of column 1, 2 and 3 has been customized

todo:image_alt_text

// 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");