GrapeCity MultiRow Windows Forms Documentation
FreezeRightCellIndex Property
Example 


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

Property Value

A System.Int32 value that represents the cell index used to freeze the right side of the control. The default is -1 which means do not freeze the right 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 edge of the specific cell to the right edge of the section 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 specific cell to the right edge of the section, plus the width of the area from the right edge of the section to the right edge of the left frozen cell, 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 setRightFreezeButton_Click(object sender, EventArgs e)
        {
            // You can use FreezeRightCellIndex instead of FreezeRightCellName to indicate which cell will be frozen.
            if (string.IsNullOrEmpty(this.gcMultiRow1.FreezeRightCellName))
            {
                // Freeze some rows in top of gcMultiRow.
                this.gcMultiRow1.FreezeRightCellName = "textBoxCell10";
                // this.gcMultiRow1.FreezeRightCellIndex = 0;
            }
            else
            {
                // Unfreeze rows in top of gcMultiRow.
                this.gcMultiRow1.FreezeRightCellName = string.Empty;
                // this.gcMultiRow1.FreezeRightCellIndex = -1;
            }
        }
Private Sub setRightFreezeButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles setRightFreezeButton.Click
        ' You can use FreezeRightCellIndex instead of FreezeRightCellName to indicate which cell will be frozen.
        If String.IsNullOrEmpty(Me.gcMultiRow1.FreezeRightCellName) Then
            ' Freeze some rows in top of gcMultiRow.
            ' this.gcMultiRow1.FreezeRightCellIndex = 0;
            Me.gcMultiRow1.FreezeRightCellName = "textBoxCell10"
        Else
            ' Unfreeze rows in top of gcMultiRow.
            ' this.gcMultiRow1.FreezeRightCellIndex = -1;
            Me.gcMultiRow1.FreezeRightCellName = 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
FreezeRightCellName Property
FreezeLines Property

 

 


Copyright © GrapeCity, inc. All rights reserved.