冻结解冻行和列

冻结列

要使用 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)。会产生unfrozen columns的效果
// 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;