Back to Devexpress

ColumnViewOptionsSelection.MultiSelect Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-columnviewoptionsselection.md

latest8.9 KB
Original Source

ColumnViewOptionsSelection.MultiSelect Property

Gets or sets whether multiple rows, cards, or cells can be selected.

Namespace : DevExpress.XtraGrid.Views.Base

Assembly : DevExpress.XtraGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(false)]
[XtraSerializableProperty]
public virtual bool MultiSelect { get; set; }
vb
<DefaultValue(False)>
<XtraSerializableProperty>
Public Overridable Property MultiSelect As Boolean

Property Value

TypeDefaultDescription
Booleanfalse

true , to enable multiple row/card/cell selection; otherwise, false.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to MultiSelect
ColumnView

.OptionsSelection .MultiSelect

|

Remarks

Set the View’s OptionsSelection.MultiSelect property to true to enable multiple row/card/cell selection:

csharp
gridView1.OptionsSelection.MultiSelect = true;
vb
gridView1.OptionsSelection.MultiSelect = True

Read the following topic for additional information and examples:

Selection Mode

The WinForms Data Grid supports the following selection modes:

  • Multiple Row/Card Selection – A user can select several rows/cards.
  • Multiple Cell Selection – A user can select multiple cells within different rows.
  • Web Style Row Selection in GridView

Use the View’s OptionsSelection.MultiSelectMode property to specify the selection mode:

csharp
using DevExpress.XtraGrid.Views.Grid;

//...
gridView1.OptionsSelection.MultiSelect = true;
gridView1.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect;
vb
Imports DevExpress.XtraGrid.Views.Grid

'...
gridView1.OptionsSelection.MultiSelect = True
gridView1.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect

Note

Multiple rows cannot be selected regardless of the MultiSelect property’s value if cell merging is enabled.

The following code snippets (auto-collected from DevExpress Examples) contain references to the MultiSelect property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-mvvm-expenses-app/CS/MVVMExpenses/Views/Account/AccountsView.cs#L22

csharp
gridView1.OptionsBehavior.Editable = false;
gridView1.OptionsSelection.MultiSelect = true;
gridView1.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.RowSelect;

winforms-grid-select-rows-using-mouse-without-ctrl/CS/MultiSelectionHelper.cs#L27

csharp
_GridView.OptionsBehavior.Editable = false;
_GridView.OptionsSelection.MultiSelect = true;
_GridView.OptionsSelection.EnableAppearanceFocusedCell = false;

winforms-grid-data-navigator-custom-button/CS/CustomButton/Form1.cs#L18

csharp
new DevExpress.XtraGrid.Design.XViewsPrinting(gridControl1);
gridView1.OptionsSelection.MultiSelect = true;

winforms-grid-move-cell-using-drag-drop/CS/Form1.cs#L19

csharp
gridView1.OptionsBehavior.EditorShowMode = DevExpress.Utils.EditorShowMode.MouseDownFocused;
gridView1.OptionsSelection.MultiSelect = true;
gridView1.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect;

winforms-grid-multi-cell-editing/CS/Form1.cs#L23

csharp
gridControl1.DataSource = DataHelper.CreateTable(20);
gridView1.OptionsSelection.MultiSelect = true;
gridView1.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect;

winforms-mvvm-expenses-app/VB/MVVMExpenses/Views/Account/AccountsView.vb#L25

vb
gridView1.OptionsBehavior.Editable = False
gridView1.OptionsSelection.MultiSelect = True
gridView1.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.RowSelect

winforms-grid-select-rows-using-mouse-without-ctrl/VB/MultiSelectionHelper.vb#L22

vb
_GridView.OptionsBehavior.Editable = False
_GridView.OptionsSelection.MultiSelect = True
_GridView.OptionsSelection.EnableAppearanceFocusedCell = False

winforms-grid-data-navigator-custom-button/VB/CustomButton/Form1.vb#L18

vb
Dim tmp_XViewsPrinting = New DevExpress.XtraGrid.Design.XViewsPrinting(gridControl1)
gridView1.OptionsSelection.MultiSelect = True
gridControl1.UseEmbeddedNavigator = True

winforms-grid-move-cell-using-drag-drop/VB/Form1.vb#L18

vb
gridView1.OptionsBehavior.EditorShowMode = DevExpress.Utils.EditorShowMode.MouseDownFocused
gridView1.OptionsSelection.MultiSelect = True
gridView1.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect

winforms-grid-multi-cell-editing/VB/Form1.vb#L24

vb
gridControl1.DataSource = DataHelper.CreateTable(20)
gridView1.OptionsSelection.MultiSelect = True
gridView1.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect

See Also

MultiSelectMode

AllowCellMerge

Multiple Row and Cell Selection

End-User Capabilities: Selecting Rows/Cards

ColumnViewOptionsSelection Class

ColumnViewOptionsSelection Members

DevExpress.XtraGrid.Views.Base Namespace