冻结解冻行和列
Contents
[
Hide
]
该主题涉及工作表行和列的冻结和解冻信息。冻结列或行使用户在滚动到工作表的其他部分时保持列标题或行标题可见。对于滚动包含大量数据的工作表非常有帮助。因为在这种情况下,当用户滚动数据时,只有数据会被滚动,标题将保持在那里以增加数据的可读性。
冻结列
使用Aspose.Cells.GridDesktop冻结工作表的列,请按照以下步骤操作:
- 访问任何所需的工作表
- 设置工作表中的冻结列数
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 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)。这会产生取消冻结列的效果
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 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冻结工作表的行,请按照以下步骤操作:
- 访问任何所需的工作表
- 设置工作表中的冻结行数
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 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)。这将产生解冻行的效果
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 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; |