MultiRow Windows Forms > Developer's Guide > Using MultiRow > Rows and Cells > 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.
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.
This example freezes the top two rows.
GcMultiRow1.RowCount = 10 GcMultiRow1.FreezeTopRowCount = 2 |
gcMultiRow1.RowCount = 10; gcMultiRow1.FreezeTopRowCount = 2; |
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.
This example freezes a cell.
' When specifying the cell index GcMultiRow1.FreezeLeftCellIndex = 0 ' When specifying the cell name GcMultiRow1.FreezeLeftCellName = "TextBoxCell1" |
// When specifying the cell index gcMultiRow1.FreezeLeftCellIndex = 0; // When specifying the cell name gcMultiRow1.FreezeLeftCellName = "textBoxCell1"; |
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.
This example freezes a cell.
GcMultiRow1.FreezeRightCellIndex = 0 |
gcMultiRow1.FreezeRightCellIndex = 0; |
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).
This example freezes the bottom two rows.
GcMultiRow1.RowCount = 10 GcMultiRow1.FreezeBottomRowCount = 2 |
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. |
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}).
The following code freezes the last two rows and changes the line between the scrolling and non-scrolling rows to a solid blue line.
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 |
using GrapeCity.Win.MultiRow; gcMultiRow1.RowCount = 100; gcMultiRow1.FreezeBottomRowCount = 2; FreezeLines freezeLines = new FreezeLines(new Line(LineStyle.Thin, Color.Blue)); gcMultiRow1.FreezeLines = freezeLines; |
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.