Bereiche einfrieren und freigeben

Einfrieren von Zeilen und Spalten

So frieren Sie eine bestimmte Anzahl von Zeilen und Spalten ein:

  1. Fügen Sie einem Webformular das Aspose.Cells.GridWeb-Steuerelement hinzu.
  2. Greifen Sie auf ein Arbeitsblatt zu.
  3. Frieren Sie eine Reihe von Zeilen und Spalten ein.
// 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);

Auftauen von Zeilen und Spalten

So heben Sie die Fixierung von Zeilen und Spalten auf:

  1. Fügen Sie einem Webformular das Aspose.Cells.GridWeb-Steuerelement hinzu.
  2. Greifen Sie auf ein Arbeitsblatt zu.
  3. Entsperren Sie Zeilen und Spalten.
// 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();