Skip to main content

Columns

Most FDC grid columns are field-bound declarations. The fieldName must resolve to a compatible field in the dataset schema.

const FdcTextColumn<dynamic>(
id: 'companyColumn',
fieldName: 'company',
label: 'Company',
width: 240,
minWidth: 140,
maxWidth: 420,
)

Stable column identity

Use id when a column must preserve runtime layout state across rebuilds or be targeted by FdcGridController commands.

final controller = FdcGridController();

FdcGrid(
controller: controller,
dataSet: customers,
columns: const [
FdcTextColumn<dynamic>(
id: 'cityColumn',
fieldName: 'city',
),
],
)

Later:

controller.focusColumn('cityColumn');
controller.hideColumn('cityColumn');
controller.showColumn('cityColumn');

Common column controls

All standard field-bound columns share common configuration such as:

  • label, hint, visible, and enabled
  • readOnly, tabStop, and focusOrder
  • width, minWidth, maxWidth, and autoSizeMode
  • allowSort, filterConfig, and allowResize
  • horizontalAlignment
  • pin
  • summary
  • onValueChanging, onValueChanged, and onLookup

Column pinning

const FdcTextColumn<dynamic>(
fieldName: 'company',
pin: FdcGridColumnPin.start,
)

Interactive pinning is opt-in. Enable it globally when users should be able to pin and unpin columns from grid menus:

FdcGrid(
dataSet: customers,
pinning: const FdcGridColumnPinning(enabled: true),
)

Programmatic initial pinning through FdcGridColumn.pin remains available independently of interactive pinning.

Duplicate field bindings

Multiple columns may bind to the same field. Give them distinct id values when each column needs independent layout state.