凍結および凍結の解除
Contents
[
Hide
]
このトピックでは、行や列を凍結および解凍する方法について説明します。列や行を凍結すると、ユーザーはワークシートの他の部分にスクロールする際にも、列の見出しや行のタイトルを表示した状態で保持することができます。この機能は、大量のデータを含むワークシートで作業する際に非常に役立ちます。ユーザーがスクロールする際にも、見出しはそのままでデータのみがスクロールし、データを見やすくします。凍結の機能は、Internet Explorer 6.0 以降でのみサポートされています。
行と列の凍結
特定の行数と列数を凍結するには:
- Web フォームに Aspose.Cells.GridWeb コントロールを追加します。
- ワークシートにアクセスします。
- 行数と列数を凍結します。
インターフェースを使用して特定の行数と列数を凍結することも可能です。行数と列数を凍結したいセルを右クリックし、リストから 凍結 を選択します。
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); |
行と列の凍結を解除
行と列を解凍するには:
- Web フォームに Aspose.Cells.GridWeb コントロールを追加します。
- ワークシートにアクセスします。
- 行と列を解凍します。
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(); |