DataGrid column configuration; it has no standalone UI.
TxColumn
| Parameter | Type | Default | Meaning |
|---|---|---|---|
| caption | String | required | Visible field/column caption. |
| valueGetter | Object? Function(T row) | required | Reads the field value to display. |
| dataField | String? | null | Field name; must be unique within a grid. |
| width | double | 160 | Width; Vue numbers use pixels, Flutter uses logical pixels. |
| allowSorting | bool | true | Allows sorting this column. |
| allowFiltering | bool | true | Allows filtering this column. |
| visible | bool | true | Controls visibility. |
| alignment | Alignment | Alignment.centerLeft | Content alignment. |
| cellBuilder | Widget Function(BuildContext context, T row, Object? value)? | null | Builds custom content; callback arguments and return type are given in the signature. |
import 'package:flutter/material.dart';
import 'package:tecexpress/tecexpress.dart';
Widget example() {
final rows = <Map<String, Object>>[{'id': 1, 'name': 'Alex'}];
return TxDataGrid<Map<String, Object>>(dataSource: rows, keyOf: (row) => row['id']!, columns: [TxColumn(caption: 'Name', valueGetter: (row) => row['name'], cellBuilder: (context, row, value) => Text('$value'))]);
}