GrapeCity MultiRow Windows Forms Documentation
FreezeLeftCellIndex Property
Example 


Gets or sets the cell index to freeze (nonscrolling) on the left side of the control.
Syntax
<SRCategoryAttribute("Behavior")>
<SRDescriptionAttribute("Indicates the index of the cell whose right edge is the location of the left freeze line.")>
<DefaultValueAttribute()>
<RefreshPropertiesAttribute(RefreshProperties.All)>
Public Property FreezeLeftCellIndex As Integer
Dim instance As GcMultiRow
Dim value As Integer
 
instance.FreezeLeftCellIndex = value
 
value = instance.FreezeLeftCellIndex
[SRCategory("Behavior")]
[SRDescription("Indicates the index of the cell whose right edge is the location of the left freeze line.")]
[DefaultValue()]
[RefreshProperties(RefreshProperties.All)]
public int FreezeLeftCellIndex {get; set;}

Property Value

An System.Int32 value that represents the cell index to freeze on the left side. The default is -1 which means do not freeze the left side.
Exceptions
ExceptionDescription
System.ArgumentOutOfRangeExceptionThe specified value is less than -1.
Remarks

If this property's value is not -1, the area from the left section edge to the right edge of the specific cell is frozen.

If this property's value is equal to or greater than the row cell count, this property does not take effect, and the control does not throw an exception. If changing the template causes the cell count to increase or this property's value decreases to a valid value, this property takes effect.

If the area width from the left edge of the section to the right edge of the specific cell plus the width of the area from the right edge of the right frozen cell to the right edge of the section is greater than the control's width, the whole control is frozen. This situation should be avoided.

Example
The following code example shows how to use this property to freeze cells. This code example is part of a larger example provided for the FreezeLines property.
void setLeftFreezeButton_Click(object sender, EventArgs e)
        {
            // You can use FreezeLeftCellIndex instead of FreezeLeftCellName to indicate which cell will be frozen.
            if (string.IsNullOrEmpty(this.gcMultiRow1.FreezeLeftCellName))
            {
                // Freeze some rows in top of gcMultiRow.
                this.gcMultiRow1.FreezeLeftCellName = "textBoxCell1";
                // this.gcMultiRow1.FreezeLeftCellIndex = 0;
            }
            else
            {
                // Unfreeze rows in top of gcMultiRow.
                this.gcMultiRow1.FreezeLeftCellName = string.Empty;
                // this.gcMultiRow1.FreezeLeftCellIndex = -1;
            }
        }
Private Sub setLeftFreezeButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles setLeftFreezeButton.Click
        ' You can use FreezeLeftCellIndex instead of FreezeLeftCellName to indicate which cell will be frozen.
        If String.IsNullOrEmpty(Me.gcMultiRow1.FreezeLeftCellName) Then
            ' Freeze some rows in top of gcMultiRow.
            ' this.gcMultiRow1.FreezeLeftCellIndex = 0;
            Me.gcMultiRow1.FreezeLeftCellName = "textBoxCell1"
        Else
            ' Unfreeze rows in top of gcMultiRow.
            ' this.gcMultiRow1.FreezeLeftCellIndex = -1;
            Me.gcMultiRow1.FreezeLeftCellName = String.Empty
        End If
    End Sub
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

GcMultiRow Class
GcMultiRow Members
FreezeLeftCellName Property
FreezeLines Property

 

 


Copyright © GrapeCity, inc. All rights reserved.