windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-columnviewoptionsselection.md
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
[DefaultValue(false)]
[XtraSerializableProperty]
public virtual bool MultiSelect { get; set; }
<DefaultValue(False)>
<XtraSerializableProperty>
Public Overridable Property MultiSelect As Boolean
| Type | Default | Description |
|---|---|---|
| Boolean | false |
true , to enable multiple row/card/cell selection; otherwise, false.
|
You can access this nested property as listed below:
| Object Type | Path to MultiSelect |
|---|---|
| ColumnView |
.OptionsSelection .MultiSelect
|
Set the View’s OptionsSelection.MultiSelect property to true to enable multiple row/card/cell selection:
gridView1.OptionsSelection.MultiSelect = true;
gridView1.OptionsSelection.MultiSelect = True
Read the following topic for additional information and examples:
The WinForms Data Grid supports the following selection modes:
Use the View’s OptionsSelection.MultiSelectMode property to specify the selection mode:
using DevExpress.XtraGrid.Views.Grid;
//...
gridView1.OptionsSelection.MultiSelect = true;
gridView1.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect;
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
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
_GridView.OptionsBehavior.Editable = false;
_GridView.OptionsSelection.MultiSelect = true;
_GridView.OptionsSelection.EnableAppearanceFocusedCell = false;
winforms-grid-data-navigator-custom-button/CS/CustomButton/Form1.cs#L18
new DevExpress.XtraGrid.Design.XViewsPrinting(gridControl1);
gridView1.OptionsSelection.MultiSelect = true;
winforms-grid-move-cell-using-drag-drop/CS/Form1.cs#L19
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
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
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
_GridView.OptionsBehavior.Editable = False
_GridView.OptionsSelection.MultiSelect = True
_GridView.OptionsSelection.EnableAppearanceFocusedCell = False
winforms-grid-data-navigator-custom-button/VB/CustomButton/Form1.vb#L18
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
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
gridControl1.DataSource = DataHelper.CreateTable(20)
gridView1.OptionsSelection.MultiSelect = True
gridView1.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect
See Also
Multiple Row and Cell Selection
End-User Capabilities: Selecting Rows/Cards
ColumnViewOptionsSelection Class