You can use the _Style suffix on a ViewModel grid or table column to supply the style name for another column; this is for developers who need per-cell styling in a rendered grid.
Special column-name conventions
A ViewModel column name can have special meaning to a renderer. The confirmed convention documented for ViewModel grids and tables is the _Style suffix.
| Naming pattern | Meaning | Where it applies | Example |
|---|---|---|---|
<ColumnName>_Style
|
Supplies the style name for the column named <ColumnName>.
|
ViewModel grids and tables. | Attribute1_Style supplies the style for Attribute1.
|
Style a grid column with _Style
Use a companion column whose name is the target column name followed by _Style.
- In the ViewModel Editor, create or locate the grid or table ViewModel class.
- Add the column that contains the value to display. For example, name it
Attribute1. - Add a second column named
Attribute1_Style. - Put the style name to apply to
Attribute1inAttribute1_Style. - Render the ViewModel grid or table. The renderer uses the value of the companion style column to convey styling for the matching column.
For example, the two columns below are paired by name:
| Display column | Companion style column | Result |
|---|---|---|
Attribute1
|
Attribute1_Style
|
The style name held by Attribute1_Style is used for Attribute1.
|
The base name must match exactly. A column named Amount_Style applies to Amount; it does not apply to a column named OrderAmount.
For the documented grid/table behavior, see Documentation:Table Grid Column Style.
Names and tagged values are different
The _Style convention is part of the column name. It is not a tagged value.
Tagged values configure separate rendering behavior without changing the column name. For example, the documented DataIsImageUrl, DataIsLink, and BlobDownloadLink tagged values affect how column data is rendered. Use the documented tagged value when you need that behavior; use _Style when you need a companion column that conveys a style name.
Scope and limitations
This page documents the special column-name convention confirmed by the available documentation. Do not assume that a suffix or prefix has special meaning unless it is documented for the renderer you use.
ViewModel layout settings, such as grid column and row counts and default dimensions, are configured separately. See Documentation:ViewModel settings.
