冻结和解冻窗格
Contents
[
Hide
]
本主题说明如何冻结和解冻行和列。冻结列或行允许用户在滚动到工作表的其他部分时保持列标题或行标题可见。在处理包含大量数据的工作表时,此功能非常有用。当用户滚动时,只有数据向下滚动,标题保持不变,使日期更容易阅读。仅 Internet Explorer 6.0 或更高版本支持冻结窗格功能。
冻结行和列
要冻结特定数量的行和列:
- 将 Aspose.Cells.GridWeb 控件添加到 Web 窗体。
- 访问工作表。
- 冻结一些行和列。
也可以使用界面冻结特定数量的行和列。右键单击要冻结行和列的单元格,然后选择冻结从列表中。
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 | |
// Get user inputs for row, column, number of rows and number of columns | |
int row = Convert.ToInt16(txtRow.Text.Trim()); | |
int column = Convert.ToInt16(txtColumn.Text.Trim()); | |
int noOfRows = Convert.ToInt16(txtNoOfRows.Text.Trim()); | |
int noOfColumns = Convert.ToInt16(txtNoOfColumns.Text.Trim()); | |
// Accessing the reference of the worksheet that is currently active | |
GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex]; | |
// Freeze desired rows and columns | |
sheet.FreezePanes(row, column, noOfRows, noOfColumns); |
解冻行和列
解冻行和列:
- 将 Aspose.Cells.GridWeb 控件添加到 Web 窗体。
- 访问工作表。
- 解冻行和列。
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 reference of the worksheet that is currently active | |
GridWorksheet sheet = GridWeb1.WorkSheets[GridWeb1.ActiveSheetIndex]; | |
// Unfreezing rows and columns | |
sheet.UnFreezePanes(); |