The standard guidance is do not add a variable number of checkbox controls to a standard D365 F&O grid at runtime. Grid controls are designed to bind to fields on the form datasource; dynamically added unbound checkboxes do not reliably maintain a per-row visual state as rows are scrolled, selected, or refreshed.
The cleanest supported design is to normalize the packed string into a child table:
MyLineTypeState
LineRefRecId
TypeId
IsActive (NoYes)
Add it as a datasource joined to the line table, put the checkbox field in the grid, and filter the child datasource by the active types for the selected site. Each checkbox then becomes a real database field on a real row, so editing, display refresh, save, and navigation work through the standard framework.
If you cannot change the data model, use a fixed upper bound say 20 checkbox columns each with its own edit method on the line datasource, and show/hide the unused columns based on the site setup. Avoid relying on runtime-added controls and active() overrides for grid cell values.
If this is genuinely a matrix requirement, consider the Table Control instead of a standard grid. It supports dynamic rows/columns and different cell controls, but it is unbound, so you must handle buffering, edit tracking, validation, and persistence manually.
confiz
For 15–20 site-driven types, I would strongly prefer option 1: one child record per line/type. It is more maintainable, queryable, and avoids the display-refresh problem entirely.
Thanks