凍結および凍結の解除

行と列の凍結

特定の行数と列数を凍結するには:

  1. Web フォームに Aspose.Cells.GridWeb コントロールを追加します。
  2. ワークシートにアクセスします。
  3. 行数と列数を凍結します。
// 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);

行と列の凍結を解除

行と列を解凍するには:

  1. Web フォームに Aspose.Cells.GridWeb コントロールを追加します。
  2. ワークシートにアクセスします。
  3. 行と列を解凍します。
// 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();