Intersoft WebGrid Documentation
Column Freezing
See Also Send comments on this topic.
Intersoft WebGrid > WebGrid Features Overview > Customizing UI > Column Freezing

Glossary Item Box

This topic contains the following sections:

Introduction

WebGrid is the industry's first WebGrid that successfully implements Microsoft Excel style column freezing feature. In this new version, WebGrid introduces LiveFreeze technology which enables users to "lively" perform column freezing and unfreezing in realtime without the need of postback or callback.

WebGrid's unique LiveFreeze architecture enables frozen columns to stay visible eventhough the horizontal scrollbar of the WebGrid is scrolled. Some of great results from LiveFreeze implementation are:

The following image shows a simple WebGrid with Column Freezing feature enabled. The OrderID and CustomerID column remains visible, while the horizontal scrollbar is set to the right most position.

 

Main Concept

LiveFreeze™ enables you to configure initial column freezing setting from server side property. There are two main properties that need to be set to activate this feature: AllowColumnFreezing property in LayoutSettings and ActiveFrozenColumns property in FreezePaneSettings.

The ActiveFrozenColumns property defines how many columns are frozen in initial page load. The default value is 0, which indicates there are no frozen columns that need to be configured. The value of ActiveFrozenColumns property determines the number of visible columns to be frozen in respective columns order. For instance, if you have a WebGrid with columns "FirstName, LastName, ContactTitle" and LastName's Visible is False and ActiveFrozenColumns set to 2, then the active frozen columns would be "FirstName" and "ContactTitle".
It is best practice to keep the ActiveFrozenColumns property to a value where the column freezing feature may deliver best results in user experience. For instance, if you set ActiveFrozenColumns to a value exceeding half of the columns length, then the column freezing display might not be useful.
Most settings related to column freezing are represented in FreezePaneSettings object, which is located inside LayoutSettings. You can also configure the MaxFrozenColumns, the splitter's line color and style and much more.
The above image shows a WebGrid with ActiveFrozenColumns property set to 2.

 

Runtime freezing/unfreezing

WebGrid's LiveFreeze™ feature allows users to perform freezing/unfreezing at runtime through column context menu. When the WebGrid detects an active frozen settings, the Unfreeze Pane command will be enabled. Likewise, the Freeze Pane command will be enabled if the WebGrid does not have an active frozen columns.

The runtime freezing feature can be easily enabled by setting ShowInContextMenu property in FreezePaneSettings object to True.

For example:

HTML Copy Code
<ISWebGrid:WebGrid ID="WebGrid1" runat="server">
   <LayoutSettings AllowColumnFreezing="Yes" AllowColumnMove="Yes">
      <FreezePaneSettings ActiveFrozenColumns="2" MaxFrozenColumns="3" ShowInContextMenu="True" />
   </LayoutSettings>
</ISWebGrid:WebGrid>

The following image shows the result of the above sample in Mozilla Firefox 2.0 browser:

 

 

Absolute Scrolling

To better simulate Excel® scrolling behavior while freezing is active, WebGrid.NET Enterprise® 5.0 introduces Absolute Scrolling™ in conjunction with the LiveFreeze™ implementation.

With Absolute Scrolling enabled, WebGrid is able to automatically adjust the viewport to the next available column when user pressed on the left/right arrow of horizontal scrollbar. This behavior allows users to conveniently scroll through all the columns with less clicks.
This feature is controlled through AbsoluteScrolling property in FreezePaneSettings object. To learn more, see How-to: Enable absolute scrolling.

 

LiveFreeze™ behaviors and other notes

The following is a list of helpful notes related to LiveFreeze™ behaviors when used with other WebGrid's features:

See Also

©2012 Intersoft Solutions Corp. All Rights Reserved.