Freezing Panes

Intro

This Demo Imports an Excel File from a source and demonstrates Freezing Panes.

Description

Freezing Panes allows you to select data that remains visible when scrolling in a sheet. For example, keeping row and column labels visible as you scroll. GridWeb Component allows you freeze panes by selecting "Freeze" option in the context menu of the control at run time. You may also freeze/unfreeze panes programmatically using FreezePanes() and UnfreezePane() Methods of WebWorksheet Class.


The Demo Imports an Excel File named "FreezePane.xls" from "file" Folder in the Application Directory to GridWeb Control and splits the sheet named "Products Sales".

API Reference

public abstract void FreezePanes( int row, int column, int rowNumber, int columnNumber );

For further reference, Click here

Example Code

// Imports an Excel File. 
GridWeb1.WebWorksheets.ImportExcelFile(fileName);
// Creates a sheet Object with reference to first Worksheet of GridWeb Control. 
WebWorksheet sheet = GridWeb1.WebWorksheets[0]; 
// Freezes the panes. 
sheet.FreezePanes( 3,2,3,2); 
The above code Imports an Excel File from "fileName" where "fileName" is a variable in which source file name and its path is stored. The last statement freezes the panes at C4 cell.
Note: Freezing Panes feature only supports IE 6.0 or above browsers.

Useful APIs

You can utilize FreezePaneInfo Class from Aspose.Grid.Web.Data Namespace in association with Freezing Panes. The class represents the freeze pane's information.

Knowledge Based

If you perform the operation (Freezing Panes) twice, the last action will override the first one.

Procedure

Click the "Reload" button to refresh the Results.

Run the demo

[Run Sample]