You can control the display format of an individual ViewModel column in the MDriven WPF fat client by setting its StringFormat tagged value; use this when that column must override the format supplied by its style.
Purpose and scope
This page describes the WPF fat-client behavior of the StringFormat tagged value on a ViewModel column.
The WPF client builds its user interface from ViewModel metadata. A ViewModel-column tagged value is therefore available to the client when it determines how to bind and display that column. This setting applies to the MDriven WPF fat client, not to the Turnkey Web UI.
StringFormat tagged value
Set the tagged value named StringFormat on a ViewModel column to provide the binding StringFormat for that column.
The tagged value value is used as the column's format. It takes precedence over the format defined by the column's style reference.
| Configuration location | Used when | Precedence |
|---|---|---|
StringFormat tagged value on the ViewModel column
|
The tagged value has a value | 1 — highest |
<StyleRef>.StringFormat
|
The ViewModel-column StringFormat tagged value has no value
|
2 — fallback |
Configure a column-specific format
- In MDriven Designer, select the ViewModel column whose displayed value needs a different format.
- Add or update the column's
StringFormattagged value. - Enter the format value that the WPF binding should use.
- Run the WPF fat client and inspect the column in the rendered view.
Keep the tagged value empty or remove it when the column should inherit its format from <StyleRef>.StringFormat.
Precedence example
Assume a ViewModel column has a StyleRef whose StringFormat is set to Style format A.
- If the column has no
StringFormattagged value value, the WPF client uses Style format A. - If the column's
StringFormattagged value is set to Column format B, the WPF client uses Column format B instead.
This lets columns that share a StyleRef use a common format by default while allowing one column to display its value differently.
When to use this tagged value
Use the column-level StringFormat tagged value when:
- a single ViewModel column needs a format that differs from other columns using the same StyleRef;
- you want the formatting decision stored with the ViewModel column metadata; or
- the StyleRef provides a default format, but a specific view requires an override.
Do not use this WPF-specific rule as guidance for web rendering. For Turnkey Web UI tagged values, see Documentation:Important TaggedValues for MDriven Turnkey Web-UI is found Here.
