FlexGrid for WinForms
Freezing Rows and Columns
Show AllShow All
Hide AllHide All

To allow the user to freeze rows and columns with the mouse, set the AllowFreezing property to Columns to freeze only columns, Rows to freeze only rows, or Both to freeze both columns and rows. Conversely, to disable freezing, set the AllowFreezing property to None, which is the default setting. This property can be set either in the designer or in code.

In the Designer

Locate the AllowFreezing property in the Properties window and set it to Both.

In Code

Add the following code to the Form_Load event to set the AllowFreezing property to Both:

To write code in Visual Basic

To write code in C#

This topic illustrates the following:

When the mouse pointer becomes the lock rows or the lock columns icon, click and drag the mouse over the rows or columns to freeze. In this example, the Element column is frozen and will remain on the grid when it is scrolled to the right.


In this example, the row containing Hydrogen is frozen and will remain on the grid when it is scrolled to the bottom.


Note: Setting the AllowFreezing property to Both allows both rows and columns to be frozen at the same time, as seen in the following image.

 

 


Copyright © GrapeCity, inc. All rights reserved.

Product Support Forum |  Documentation Feedback