冻结解冻行和列

冻结列

使用Aspose.Cells.GridDesktop冻结工作表的列,请按照以下步骤操作:

  • 访问任何所需的工作表
  • 设置工作表中的冻结列
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Accessing the worksheet of the Grid that is currently active
Worksheet sheet = gridDesktop1.GetActiveWorksheet();
// Setting the number of frozen columns to 2
sheet.FrozenCols = 2;

取消冻结列

使用Aspose.Cells.GridDesktop取消冻结工作表的列,请按照以下步骤操作:

  • 访问任何所需的工作表
  • 工作表中将冻结列数设置为零(0)。这会产生取消冻结列的效果
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Accessing the worksheet of the Grid that is currently active
Worksheet sheet = gridDesktop1.GetActiveWorksheet();
// Setting the number of frozen columns to 0 for unfreezing columns
sheet.FrozenCols = 0;

冻结行

使用Aspose.Cells.GridDesktop冻结工作表的行,请按照以下步骤操作:

  • 访问任何所需的工作表
  • 设置工作表中的冻结行
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Accessing the worksheet of the Grid that is currently active
Worksheet sheet = gridDesktop1.GetActiveWorksheet();
// Setting the number of frozen rows to 2
sheet.FrozenRows = 2;

取消冻结行

要使用Aspose.Cells.GridDesktop解冻工作表的行,请按照以下步骤操作:

  • 访问任何所需的工作表 -在工作表中将冻结行的数量设为零(0)。这将产生解冻行的效果
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Accessing the worksheet of the Grid that is currently active
Worksheet sheet = gridDesktop1.GetActiveWorksheet();
// Setting the number of frozen rows to 0 for unfreezing rows
sheet.FrozenRows = 0;