FlexGrid for WinForms
Selected Property (RowCollection)
Example 



Gets a collection of Row objects that are currently selected.
Syntax
'Declaration
 
<BrowsableAttribute(False)>
<DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden)>
Public ReadOnly Property Selected As RowCollection
'Usage
 
Dim instance As RowCollection
Dim value As RowCollection
 
value = instance.Selected
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public RowCollection Selected {get;}
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public:
property RowCollection^ Selected {
   RowCollection^ get();
}
Remarks
This property is especially useful when the grid's SelectionMode property is set to SelectionModeEnum.ListBox.
Example

The code below removes all selected rows from the grid.

Note that foreach loops can't be used to modify the collections being iterated over. This example works because the Selected collection is being enumerated while the Rows collection is being modified.

// delete all selected rows
foreach (Row r in _flex.Rows.Selected)
{
    _flex.Rows.Remove(r);
}
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

RowCollection Class
RowCollection Members

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Send Feedback