Back to Devexpress

GridOptionsSelection.MultiSelectMode Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-grid-dot-gridoptionsselection-5db7c04c.md

latest9.1 KB
Original Source

GridOptionsSelection.MultiSelectMode Property

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

Namespace : DevExpress.XtraGrid.Views.Grid

Assembly : DevExpress.XtraGrid.v25.2.dll

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

Declaration

csharp
[DefaultValue(GridMultiSelectMode.RowSelect)]
[XtraSerializableProperty]
public virtual GridMultiSelectMode MultiSelectMode { get; set; }
vb
<DefaultValue(GridMultiSelectMode.RowSelect)>
<XtraSerializableProperty>
Public Overridable Property MultiSelectMode As GridMultiSelectMode

Property Value

TypeDefaultDescription
GridMultiSelectModeRowSelect

A GridMultiSelectMode enumeration value which specifies whether multiple cells or rows can be selected.

|

Available values:

NameDescription
RowSelect

Multiple rows can be selected via the mouse and keyboard. Individual cells cannot be selected.

| | CellSelect |

Individual cells and blocks of cells can be selected. This option is not supported in Advanced Banded Grid Views.

| | CheckBoxRowSelect |

Multiple rows can be selected via the mouse, keyboard and built-in Check column (which displays check boxes in each row). Individual cells cannot be selected.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to MultiSelectMode
GridView

.OptionsSelection .MultiSelectMode

|

Remarks

Multiple row (cell) selection is allowed, and therefore the MultiSelectMode property is in effect if the ColumnViewOptionsSelection.MultiSelect property is set to true.

csharp
gridView1.OptionsSelection.MultiSelect = true;
gridView1.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect;
vb
GridView1.OptionsSelection.MultiSelect = True
GridView1.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect

See the following topics for more information:

Demos

Online Video

DevExpress WinForms: Web Style Row Selection.

The following code snippets (auto-collected from DevExpress Examples) contain references to the MultiSelectMode 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-grid-multi-cell-editing/CS/Form1.cs#L24

csharp
gridView1.OptionsSelection.MultiSelect = true;
gridView1.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect;
behaviorManager1.Attach<MultiCellEditBehavior>(gridView1);

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

csharp
gridView1.OptionsSelection.MultiSelect = true;
    gridView1.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.RowSelect;
}

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

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

winforms-grid-drag-and-drop-selected-rows/CS/Form1.cs#L27

csharp
view.OptionsSelection.MultiSelect = true;
view.OptionsSelection.MultiSelectMode = GridMultiSelectMode.RowSelect;
view.SelectRange(3, 7);

winforms-grid-copy-cell-value-to-other-cells-by-dragging-its-right-bottom-edge/CS/Form1.cs#L22

csharp
gridView1.OptionsSelection.MultiSelect = true;
gridView1.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect;
new DataSourceHelper(gridView1, 50, 50);

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

vb
gridView1.OptionsSelection.MultiSelect = True
gridView1.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect
behaviorManager1.Attach(Of MultiCellEditBehavior)(gridView1)

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

vb
gridView1.OptionsSelection.MultiSelect = True
    gridView1.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.RowSelect
End Sub

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

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

winforms-grid-drag-and-drop-selected-rows/VB/Form1.vb#L34

vb
view.OptionsSelection.MultiSelect = True
view.OptionsSelection.MultiSelectMode = GridMultiSelectMode.RowSelect
view.SelectRange(3, 7)

winforms-grid-copy-cell-value-to-other-cells-by-dragging-its-right-bottom-edge/VB/Form1.vb#L22

vb
gridView1.OptionsSelection.MultiSelect = True
gridView1.OptionsSelection.MultiSelectMode = GridMultiSelectMode.CellSelect
Dim tempVar As New DataSourceHelper(gridView1, 50, 50)

See Also

GetSelectedCells

MultiSelect

SelectCell

GetSelectedRows()

Multiple Row and Cell Selection

GridOptionsSelection Class

GridOptionsSelection Members

DevExpress.XtraGrid.Views.Grid Namespace