Custom Freezing Panes

Intro

This Demo expresses customized Freezing Panes.

Description

GridWeb Control is an adept control while manipulating the large worksheets. The control is gifted with the capabilities like Freezing Panes and Paging. Freezing Panes helps you to view/work different areas of a large worksheet at the same time. GridWeb Component allows you freeze/unfreeze panes by selecting "Freeze/Unfreeze" option in the context menu of the control at run time. The Demo is analogous to Freezing Panes Demo .

Aspose.Grid.Web.Data.WebWorksheet Class has FreezePanes() Method used for freezing the panes at your required location in the sheet. The method accepts four arguments related to rows and columns. UnfreezePanes() Method terminate the frozen panes.

The Demo demonstrates the working programmatically with the help of four text boxes each representing rows/columns values. The values you provide in the text boxes, will decide where to freeze the panes. If you input wrong (other than int) values into the text boxes, an error message will be displayed. There are also two buttons labeled "Freeze Panes" and "Unfreeze Panes" used to on/off freezing panes. You may also save your sheet using "Save" icon of the control.

API Reference

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

For further reference, Click here

Example Code

// Creates a sheet Object with reference to first Worksheet of GridWeb Control. 
WebWorksheet sheet = GridWeb1.WebWorksheets[0]; 
// Freezes the panes. 
sheet.FreezePanes(row,column,rowNumber,columnNumber);
// Unfreezes the first sheet panes.
GridWeb1.WebWorksheets[0].UnfreezePanes();    
In the above code, a sheet object is created based on the first worksheet of the control. The second statement freezes the panes where row, column, rowNumer and columnNumber are basically the int variables representing the four text boxes' values. The last statement unfreezes the panes.
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

System.Text.RegularExpressions is a namespace in .Net APIs. It has Regex and Match classes. You may use them for custom validation. Using these two classes, the demo validates the data you enter into the text boxes.

Procedure

Input some values into the four text boxes and click the "Freeze Panes" button to see the results. Click the "Unfreeze Panes" button to unfreeze the panes.

Run the demo

[Run Sample]