GrapeCity MultiRow Windows Forms Documentation
Wrap Property
Example 


Gets or sets a value that indicates whether the collection of items continues to the first or last item if the user continues past the end of the list.
Syntax
<SRDescriptionAttribute("Indicates whether the collection of items continues to the first or last item if the user continues past the end of the list.")>
<LocalizableAttribute(True)>
<DefaultValueAttribute()>
<SRCategoryAttribute("Behavior")>
Public Property Wrap As Boolean
Dim instance As DomainUpDownCell
Dim value As Boolean
 
instance.Wrap = value
 
value = instance.Wrap
[SRDescription("Indicates whether the collection of items continues to the first or last item if the user continues past the end of the list.")]
[Localizable(true)]
[DefaultValue()]
[SRCategory("Behavior")]
public bool Wrap {get; set;}

Property Value

true if the list starts again when the user reaches the beginning or end of the collection; otherwise, false. The default is false.
Remarks
When the Wrap property is set to true, if you reach the last item in the collection and continue, the list starts over with the first item and appears to be continuous. This behavior works in reverse as well.
Example
The following code example shows how to use the Wrap property. If you set Wrap to true, the items are shown in a circular list. This example is part of a larger example available for the DomainUpDownCell class.
void setWrapButton_Click(object sender, EventArgs e)
        {
            DomainUpDownCell domainUpDownCell1 = this.gcMultiRow1[0, 0] as DomainUpDownCell;

            if (domainUpDownCell1.Wrap)
            {
                //set the Wrap to false, the items cannot be shown in a circular list.
                domainUpDownCell1.Wrap = false;
            }
            else
            {
                //set the Wrap to true, the items can be shown in a circular list.
                domainUpDownCell1.Wrap = true;
            }
            label.Text = "Click the button, the items can (or cannot) be shown in a circular list when you click the 
UpDown button";
        }
Private Sub setWrapButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles 
setWrapButton.Click
        Dim domainUpDownCell1 As DomainUpDownCell = TryCast(Me.gcMultiRow1(0, 0), DomainUpDownCell)

        If domainUpDownCell1.Wrap Then
            'set the Wrap to false, the items cannot be shown in a circular list.
            domainUpDownCell1.Wrap = False
        Else
            'set the Wrap to true, the items can be shown in a circular list.
            domainUpDownCell1.Wrap = True
        End If
        label.Text = "Click the button, the items can (or cannot) be shown in a circular list when you click the 
UpDown button"
    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.