GrapeCity MultiRow Windows Forms Documentation
Sorted Property (DomainUpDownCell)
Example 


Gets or sets a value that indicates whether the item collection is sorted.
Syntax
<SRCategoryAttribute("Behavior")>
<DefaultValueAttribute()>
<SRDescriptionAttribute("Indicates whether the item collection is sorted.")>
Public Property Sorted As Boolean
Dim instance As DomainUpDownCell
Dim value As Boolean
 
instance.Sorted = value
 
value = instance.Sorted
[SRCategory("Behavior")]
[DefaultValue()]
[SRDescription("Indicates whether the item collection is sorted.")]
public bool Sorted {get; set;}

Property Value

true if the item collection is sorted; otherwise, false. The default is false.
Remarks
When Sorted is set to true, the Items collection is sorted in alphabetical order.
Example
The following code example shows how to use the Sorted property. When you set this property to true, the items collection is sorted in alphabetical order. If you change this property from true to false, the sorted items state cannot be restored to unsorted. This example is part of a larger example available for the DomainUpDownCell class.
void setSortedButton_Click(object sender, EventArgs e)
        {
            DomainUpDownCell domainUpDownCell1 = this.gcMultiRow1[0, 0] as DomainUpDownCell;

            if (domainUpDownCell1.Sorted)
            {
                //set Sorted property from true to false, the items' sorted state cannot be restored to unsorted.
                domainUpDownCell1.Sorted = false;
            }
            else
            {
                //set it to true, the items change to the sorted state.
                domainUpDownCell1.Sorted = true;
            }
            label.Text = "Click the button, the items in the Items (7,3,5,1) property are sorted to (1,3,5,7)";
        }
Private Sub setSortedButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles 
setSortedButton.Click
        Dim domainUpDownCell1 As DomainUpDownCell = TryCast(Me.gcMultiRow1(0, 0), DomainUpDownCell)

        If domainUpDownCell1.Sorted Then
            'set Sorted property from true to false, the items sorted state cannot be restored.
            domainUpDownCell1.Sorted = False
        Else
            'set it to true, the items change to the sorted state.
            domainUpDownCell1.Sorted = True
        End If
        label.Text = "Click the button, the items in the Items (7,3,5,1) property are sorted to (1,3,5,7)"
    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

DomainUpDownCell Class
DomainUpDownCell Members

 

 


Copyright © GrapeCity, inc. All rights reserved.