Range Selection
This feature is part of FD Components Pro, which is documented as a preview and is not publicly available yet. See Editions and Availability.
Range selection adds spreadsheet-style rectangular cell selection to FdcProGrid. It is independent of row selection: row selection marks records for batch workflows, while range selection operates on a rectangular group of visible cells.
import 'package:flutter_data_components_pro/fdc_pro.dart';
FdcProGrid(
dataSet: customers,
options: const FdcGridOptions(autoEdit: true),
columns: customerColumns,
statusBar: const FdcGridStatusBar(visible: true),
rangeSelection: const FdcGridRangeSelection(),
);
Hold Shift while clicking or dragging across cells to activate range selection. On macOS, use the same modifier key: ⇧ Shift. The default feature configuration enables copying, pasting, the range context menu, and filling a multi-cell range from a single clipboard value.
Enable range selection
FdcProGrid(
dataSet: orders,
rangeSelection: const FdcGridRangeSelection(),
)
Configure clipboard behavior
FdcProGrid(
dataSet: orders,
rangeSelection: const FdcGridRangeSelection(
copy: true,
paste: true,
contextMenu: true,
fillSingleValue: true,
),
)
When fillSingleValue is enabled, pasting one clipboard value into a multi-cell range can fill every editable cell in that range.
Paste operations still respect normal grid and dataset editing rules. Read-only columns and cells that cannot be edited are not treated as writable targets.
Customize the overlay
const FdcGridRangeSelection(
borderColor: Color(0xFF2563EB),
backgroundColor: Color(0x1A2563EB),
borderThickness: 2,
)
The overlay configuration is local to the grid instance.
User interaction
Range selection is activated with the Shift modifier:
- Select or focus a starting cell.
- Hold Shift — ⇧ Shift on macOS.
- Click another cell to extend the range, or keep Shift held while dragging across cells.
- Release Shift when the range is complete. The selected range remains visible and can be copied, pasted into, or opened through the range context menu.
Without Shift, normal cell navigation and selection behavior remains active. This keeps spreadsheet-style range selection explicit and prevents ordinary pointer interaction from accidentally creating ranges.
Clear the range from code
Use the grid controller to clear an active range selection from application commands:
final cleared = gridController.clearRangeSelection();
The method returns whether range-selection state was present and cleared. See Grid Controller for controller lifecycle and other runtime commands.
Interaction notes
Range selection is available while the dataset is in browse state. The feature is temporarily unavailable while detail rows are expanded, avoiding ambiguous interaction between a rectangular cell range and expanded row content.
Use row selection for actions such as exporting selected records or performing batch commands. Use range selection for cell-oriented clipboard and spreadsheet-style workflows.