GrapeCity MultiRow Windows Forms Documentation
MultiSelect Property
Example 


Gets or sets a value that indicates whether multiple selection is allowed.
Syntax
<SRCategoryAttribute("Behavior")>
<SRDescriptionAttribute("Indicates whether the user is allowed to select more than one cell or row of the GcMultiRow control at a time.")>
<DefaultValueAttribute()>
<FeatureAttribute(Name="UISelection", Version="v5.0")>
Public Property MultiSelect As Boolean
Dim instance As GcMultiRow
Dim value As Boolean
 
instance.MultiSelect = value
 
value = instance.MultiSelect
[SRCategory("Behavior")]
[SRDescription("Indicates whether the user is allowed to select more than one cell or row of the GcMultiRow control at a time.")]
[DefaultValue()]
[Feature(Name="UISelection", Version="v5.0")]
public bool MultiSelect {get; set;}

Property Value

true if multiple selection is allowed; otherwise, false. The default is true.
Remarks

Multiple elements (cells, rows) can be selected in the GcMultiRow control when the MultiSelect property is set to true. To select multiple elements, the user can hold down the Ctrl key while clicking the elements to select, or press the left mouse button on a cell and drag the mouse to select.

You can use the MultiSelect property to allow a user to select multiple elements in the GcMultiRow control and perform an operation on all the selected elements. For example, the user could select multiple cells and then right-click a selected cell to display a shortcut menu that displays a set of tasks to perform on the selected cells.

To determine which cells or rows are selected in the GcMultiRow control, you can access the SelectedCells or SelectedRows property. To determine the number of selected cells, call the GetCellCount(MultiRowElementStates) method with an argument value of MultiRowElementStates.Selected. Use the RowCollection.GetRowCount method to retrieve the number of selected rows. These methods are more efficient than accessing the collections directly when working with large amounts of data.

Example
The following code example shows how to use this property to customize the selection behavior. This code example is part of a larger example provided for the ViewMode class.
void allowMultiSelectCheckBox_CheckedChanged(object sender, EventArgs e)
       {
           // You can only select one cell or row when MultiSelect is false.
           this.gcMultiRow1.MultiSelect = allowMultiSelectCheckBox.Checked;
       }
Private Sub allowMultiSelectCheckBox_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles 
allowMultiSelectCheckBox.CheckedChanged
        ' You can only select one cell or row when MultiSelect is false.
        Me.gcMultiRow1.MultiSelect = allowMultiSelectCheckBox.Checked
    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

 

 


Copyright © GrapeCity, inc. All rights reserved.