FlexGrid for WPF
選択
基本操作 > 選択

Most grid controls allow users to select parts of the data using the mouse and the keyboard. FlexGrid supports selection through the SelectionMode property. This property determines how the cell or rows are selected in grid.

You can set the selection mode for grid by using SelectionMode property of the C1GridControl class. The SelectionMode property sets the selection behavior through GridSelectionMode enumeration. This enumeration specifies the following values to define the selection behavior:

Selection Mode Description

Cell

To select a single cell.
CellRange To select a cell range (block of adjacent cells).
Column To select a single column.
ColumnRange To select a set of contiguous columns.
ListBox To select an arbitrary set of rows (not necessarily contiguous).
MultiColumns To select non-contiguous columns by ctrl+clicking.
MultiRange To select collection of ranges.
None To disable the selection.
Row To select a entire row.
RowRange To select a set of contiguous rows.

The following image shows selection of a range of cells in FlexGrid.

The following code illustrates how to set SelectionMode to CellRange.

C#
コードのコピー
grid.SelectionMode=C1.WPF.Grid.GridSelectionMode.CellRange;

You can set the selection mode for grid by using SelectionMode property of the C1FlexGrid class. The SelectionMode property sets the selection behavior through SelectionMode enumeration. This enumeration specifies the following values to define the selection behavior:

Selection Mode Description

Cell

To select a single cell.
CellRange To select a cell range (block of adjacent cells).
Column To select a single column.
ColumnRange To select a set of contiguous columns.
ListBox To select an arbitrary set of rows (not necessarily contiguous).
Row To select a entire row.
RowRange To select a set of contiguous rows.

The following image shows selection of a range of cells in FlexGrid.

The following code illustrates how to set SelectionMode to CellRange.

C#
コードのコピー
grid.SelectionMode= C1.WPF.FlexGrid.SelectionMode.CellRange;