Gets or sets a value indicating whether this Row is selected.
Namespace: Dapfor.Wpf.ControlsAssembly: Dapfor.Wpf (in Dapfor.Wpf.dll) Version: 4.1.0.26317 (4.1.0.26317)
Syntax
C# |
---|
public bool Selected { get; set; } |
Visual Basic |
---|
Public Property Selected As Boolean Get Set |
Visual C++ |
---|
public: property bool Selected { bool get (); void set (bool value); } |
F# |
---|
member Selected : bool with get, set |
Property Value
Type: Booleantrue if selected; otherwise, false.
Remarks
You can select single or multiple rows in the grid with Row.Selected property. All selected Row objects are
added to GridControl.Selection collection
that supports iteration. To unselect all rows, call GridControl.Selection.Clear() method.
Copy | |
---|---|
public void ExampleSelection(GridControl grid) { //Set a new semi-transparent color for selected rows grid.AppearanceSelectionBackground = new SolidColorBrush(Color.FromArgb(80, 102, 36, 10)); //Allow selection in grid grid.SettingsSelection.Enabled = true; //Allow multiple selection in grid grid.SettingsSelection.MultipleEnabled = true; //Rows in the collection should be in order grid.SettingsSelection.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(); } |