GrapeCity MultiRow Windows Forms Documentation
Freezing Rows

You can freeze the first row at the top or specific cells at the extreme left to prevent them from scrolling. Frozen rows can be used to provide an example of input to the user, compare data in rows, or for fixed display of row headers and row footers.

Freezing the Top Rows

You can specify the number of rows you want to fix in the GcMultiRow.FreezeTopRowCount property. This freezes the number of rows specified in the property, counting from the top.

Using Code

This example freezes the top two rows.

[VB]

GcMultiRow1.RowCount = 10
GcMultiRow1.FreezeTopRowCount = 2

[CS]

gcMultiRow1.RowCount = 10;
gcMultiRow1.FreezeTopRowCount = 2;

Freezing Cells on the Left Edge

You can specify the cells to be frozen on the left using the GcMultiRow.FreezeLeftCellName property or the GcMultiRow.FreezeLeftCellIndex property. This freezes (constantly displays) the cells from the left edge to the specified cell in the template.

Using Code

This example freezes a cell.

[VB]

' When specifying the cell index
GcMultiRow1.FreezeLeftCellIndex = 0

' When specifying the cell name
GcMultiRow1.FreezeLeftCellName = "TextBoxCell1"

[CS]

// When specifying the cell index
gcMultiRow1.FreezeLeftCellIndex = 0;

// When specifying the cell name
gcMultiRow1.FreezeLeftCellName = "textBoxCell1";

Freezing Cells on the Right Edge

You can specify the cells to be frozen in the GcMultiRow.FreezeRightCellName property or the GcMultiRow.FreezeRightCellIndex property. This freezes (constantly displays) the cells in the template from the right edge to the specified cell.

Using Code

This example freezes a cell.

[VB]

GcMultiRow1.FreezeRightCellIndex = 0

[CS]

gcMultiRow1.FreezeRightCellIndex = 0;

Freezing the Last Row

By specifying the number of rows to freeze in the GcMultiRow.FreezeBottomRowCount property, the specified number of rows from the bottom are frozen (constantly displayed).

Using Code

This example freezes the bottom two rows.

[VB]

GcMultiRow1.RowCount = 10
GcMultiRow1.FreezeBottomRowCount = 2

[CS]

gcMultiRow1.RowCount = 10;
gcMultiRow1.FreezeBottomRowCount = 2;
If you specify a value in the GcMultiRow.FreezeBottomRowCount property that exceeds the value of the GcMultiRow.RowCount property, a System.ArgumentOutOfRangeException is thrown.

Customizing the Line between Non-scrolling and Scrolling Areas

The line that distinguishes the non-scrolling area can be customized using the GcMultiRow.FreezeLines property. You can specify the type and color of the line. When the type of line is set to None or the color is specified as Transparent, the line is not displayed. You can also use the border of the fixed row as the line. By default, the line is a black solid line ({LineStyle=Thin, Color=Black}).

Using Code

The following code freezes the last two rows and changes the line between the scrolling and non-scrolling rows to a solid blue line.

[VB]

Imports GrapeCity.Win.MultiRow

GcMultiRow1.RowCount = 100
GcMultiRow1.FreezeBottomRowCount = 2
Dim freezeLines As FreezeLines = New FreezeLines(New Line(LineStyle.Thin, Color.Blue))
GcMultiRow1.FreezeLines = freezeLines

[CS]

using GrapeCity.Win.MultiRow;

gcMultiRow1.RowCount = 100;
gcMultiRow1.FreezeBottomRowCount = 2;
FreezeLines freezeLines = new FreezeLines(new Line(LineStyle.Thin, Color.Blue));
gcMultiRow1.FreezeLines = freezeLines;

Using the FreezeLines Editor

If you select the GcMultiRow control on the Form designer and click the GcMultiRow.FreezeLines property button in the Properties window, an editor is displayed in which you can customize the border of the frozen area, as shown in the following figure.

Borders of Frozen area

See Also

 

 


Copyright © GrapeCity, inc. All rights reserved.

Support Options