ReoGrid ReoGrid Web

Auto-fill (Fill Handle)

Auto-fill exposes Excel’s familiar fill handle — a small square at the bottom-right of the active selection. Drag it down, up, left, or right to extend the selection with values inferred from the source cells.

Detected patterns:

SourceBehavior
Single cellTile-copy. The source value is repeated in every target cell.
Numeric series (2+ cells)Arithmetic progression. 1, 23, 4, 5; 5, 1015, 20, 25.
Single date-formatted cellIncrement by one day per step.
Cells containing formulasRelative references shift the way Excel does; $-anchored references are preserved.
Styles, number formats, cell typesPropagate from the source to the new region.

Undo restores prior values, including cells that previously held different data.


Enabling and disabling

Auto-fill is enabled by default.

import { createReogrid } from '@reogrid/lite'

// Disable at construction
const { worksheet } = createReogrid('#grid', {
  autoFill: false,
})

// Toggle at runtime
worksheet.setAutoFillEnabled(true)
worksheet.setAutoFillEnabled(false)

In React / Vue, pass options={{ autoFill: false }} to the <Reogrid> component if you want to ship without the fill handle.


Programmatic fill

For tooling and tests, the value-inference logic is exposed as a pure function so you can compute the same series the UI would produce.

import { computeAutoFillValues, type AutoFillSourceCell } from '@reogrid/pro'

const source: AutoFillSourceCell[][] = [
  [{ input: '1', isFormula: false }],
  [{ input: '2', isFormula: false }],
]

const result = computeAutoFillValues(source, 'down', 5)
// result -> [{ input: '3' }, { input: '4' }, { input: '5' }, { input: '6' }, { input: '7' }]

Combine with AutoFillAction if you need to drive the fill through the standard undo/redo pipeline:

import { AutoFillAction } from '@reogrid/pro'

const action = new AutoFillAction(/* ... */)
worksheet.doAction(action)

Notes

  • The fill handle is drawn as part of the selection chrome, so it follows the active selection automatically.
  • Custom series like weekday names (Mon, Tue, ...) or month names are not detected in this release — they tile-copy instead.
  • Double-clicking the fill handle to auto-extend downward is not yet supported.
Stay Updated

Be first to know — get updates as they ship

Get notified of new releases, features, and announcements.
No spam — just updates that matter.