GrapeCity MultiRow Windows Forms Documentation
SortCellIndex Property
Example 


Gets or sets the index of the cell in the Row.
Syntax
<DefaultValueAttribute()>
<RefreshPropertiesAttribute(RefreshProperties.All)>
<SRCategoryAttribute("Behavior")>
<SRDescriptionAttribute("Indicates the index of the cell that is sorted.")>
Public Property SortCellIndex As Integer
Dim instance As ColumnHeaderCell
Dim value As Integer
 
instance.SortCellIndex = value
 
value = instance.SortCellIndex
[DefaultValue()]
[RefreshProperties(RefreshProperties.All)]
[SRCategory("Behavior")]
[SRDescription("Indicates the index of the cell that is sorted.")]
public int SortCellIndex {get; set;}

Property Value

A System.Int32 value that represents the index of the sort cell. The default is -1.
Exceptions
ExceptionDescription
System.ArgumentOutOfRangeExceptionThe specified value is less than -1.
Remarks
You can specify which cell is sorted using this property.
Example
The following code example shows how to make a column header cell perform a sort when clicking with the mouse. To run this example, create a GcMultiRow control in a form and copy the code into the Form.Load event handler.
private void Form1_Load(object sender, EventArgs e)
        {
            Template template1 = Template.CreateGridTemplate(4);

            ColumnHeaderCell columnHeaderCell = template1.ColumnHeaders[0][0] as ColumnHeaderCell;

            columnHeaderCell.SelectionMode = MultiRowSelectionMode.None;
            columnHeaderCell.SortMode = SortMode.Automatic;
            columnHeaderCell.SortCellName = "textBoxCell1";

            gcMultiRow1.Template = template1;
        }
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
        Dim template1 As Template = Template.CreateGridTemplate(4)

        Dim columnHeaderCell As ColumnHeaderCell = TryCast(template1.ColumnHeaders(0)(0), 
ColumnHeaderCell)

        columnHeaderCell.SelectionMode = MultiRowSelectionMode.None
        columnHeaderCell.SortMode = SortMode.Automatic
        columnHeaderCell.SortCellName = "textBoxCell1"

        gcMultiRow1.Template = template1
    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

ColumnHeaderCell Class
ColumnHeaderCell Members
SortMode Property
SortCellName Property
SortGlyphDirection Property

 

 


Copyright © GrapeCity, inc. All rights reserved.