Collection of selected Rows.

Namespace: Dapfor.Net.Ui
Assembly: Dapfor.Net (in Dapfor.Net.dll) Version: 2.10.3.24917 (2.10.3.24917)

Syntax

C#
[TypeConverterAttribute("Dapfor.Net.Design.ExpandableConverter,Dapfor.Net.Design,Version=2.10.3.24917,Culture=neutral,PublicKeyToken=4427dced42249680")]
public class GridSelection : IEnumerable<Row>, 
	IEnumerable
Visual Basic
<TypeConverterAttribute("Dapfor.Net.Design.ExpandableConverter,Dapfor.Net.Design,Version=2.10.3.24917,Culture=neutral,PublicKeyToken=4427dced42249680")>
Public Class GridSelection
	Implements IEnumerable(Of Row), IEnumerable
Visual C++
[TypeConverterAttribute(L"Dapfor.Net.Design.ExpandableConverter,Dapfor.Net.Design,Version=2.10.3.24917,Culture=neutral,PublicKeyToken=4427dced42249680")]
public ref class GridSelection : IEnumerable<Row^>, 
	IEnumerable
F#
[<TypeConverterAttribute("Dapfor.Net.Design.ExpandableConverter,Dapfor.Net.Design,Version=2.10.3.24917,Culture=neutral,PublicKeyToken=4427dced42249680")>]
type GridSelection =  
    class
        interface IEnumerable<Row>
        interface IEnumerable
    end

Remarks

You can select single or multiple rows in the grid with Row.Selected property and Grid.Selection.Enabled / Grid.Selection.MultipleEnabled property. All selected lines are added to Grid.Selection collection that supports iteration. To unselect all rows, call Grid.Selection.Clear() method.
 Copy imageCopy
public void ExampleSelection(Grid grid)
{
    //Set a new semi-transparent color for selected rows
    grid.Selection.Color = Color.FromArgb(80, 102, 36, 10);

    //Allow selection in grid
    grid.Selection.Enabled = true;

    //Allow multiple selection in grid
    grid.Selection.MultipleEnabled = true;

    //Rows in the collection should be in order
    grid.Selection.Sorted = true;


    //Select the 5th row
    grid.Rows[5].Selected = true;

    //Enumerate the selected rows...
    foreach (Row row in grid.Selection)
    {
        //Do something here...
    }

    //Clear the selection
    grid.Selection.Clear();
}

Inheritance Hierarchy

System..::..Object
  Dapfor.Net.Ui..::..Grid..::..GridSelection

Thread Safety

The class is not thread safe.

See Also