Frysa och avfrysa rutor

Frysa rader och kolumner

För att frysa ett visst antal rader och kolumner:

  1. Lägg till Aspose.Cells.GridWeb-kontrollen i en webbformulär.
  2. Hämta ett arbetsblad.
  3. Frysa ett antal rader och kolumner.
// 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);

Avfrysa rader och kolumner

För att avfrysa rader och kolumner:

  1. Lägg till Aspose.Cells.GridWeb-kontrollen i en webbformulär.
  2. Hämta ett arbetsblad.
  3. Avfrysa rader och kolumner.
// 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();